From a.janke at gmail.com Fri Jun 1 01:02:27 2012 From: a.janke at gmail.com (Andrew Janke) Date: Fri, 1 Jun 2012 15:02:27 +1000 Subject: [MINC-users] default slice min/max in mincreshape? In-Reply-To: References: Message-ID: Hi Alex, On 1 June 2012 13:51, Alex Zijdenbos wrote: > It's easy to fix by adding -normalize to the mincreshape call; but the > question I have is: why is the image-max for added, empty slices set > to 1 (instead of 0 for example)? It seems to me that this may cause > trouble for all volumes with real values much smaller than 1. My bet for this one is definitely on a rounding error given you combination of a very (very) small range and a byte datatype. I'd be curious to know if the same thing happens if you first convert the volume to float. a From zijdenbos at gmail.com Fri Jun 1 11:23:02 2012 From: zijdenbos at gmail.com (Alex Zijdenbos) Date: Fri, 1 Jun 2012 11:23:02 -0400 Subject: [MINC-users] default slice min/max in mincreshape? In-Reply-To: References: Message-ID: On Fri, Jun 1, 2012 at 1:02 AM, Andrew Janke wrote: > Hi Alex, > > On 1 June 2012 13:51, Alex Zijdenbos wrote: >> It's easy to fix by adding -normalize to the mincreshape call; but the >> question I have is: why is the image-max for added, empty slices set >> to 1 (instead of 0 for example)? It seems to me that this may cause >> trouble for all volumes with real values much smaller than 1. > > My bet for this one is definitely on a rounding error given you > combination of a very (very) small range and a byte datatype. I'd be > curious to know if the same thing happens if you first convert the > volume to float. Well that works; and in fact it turns out that the byte volume is also still correct (contains all the data). mincstats for example gives meaningful output, and a warning: *** mincstats - reported max (0.00048708) doesn't equal header (1) so the problem actually (and arguably) may not be with the minc volume itself, but with some other tools, such as mincblur, that probably rely on the header-reported max instead of the real (data) max, and as a result scale the very very small data values into nothingness. Either way it still seems to me that the fundamental problem is that mincreshape adds the blank slices with image-max=1, which is much higher as the image-max(es) before the padding. -- A From trash001 at odu.edu Fri Jun 1 19:31:25 2012 From: trash001 at odu.edu (Tanweer Rashid) Date: Fri, 1 Jun 2012 19:31:25 -0400 Subject: [MINC-users] cannot open shared object file Message-ID: Hi all, I installed minc2 and bicpl, followed by the Display and register programs, but when I try to run either Display or register, I get the following error message, respectively: Display: error while loading shared libraries: libvolume_io2.so.1: cannot open shared object file: No such file or directory register: error while loading shared libraries: libvolume_io2.so.1: cannot open shared object file: No such file or directory Any ideas on why I am getting these errors? I am using Ubuntu 12.04 LTS. I checked and I see that the I already have the libraries libminc2, libvolume_io2 and libbicpl in the directory /usr/local/lib The Display and register programs are in /usr/local/bin Thanks, -- Tanweer Rashid MSVE Dept. Old Dominion University From a.janke at gmail.com Fri Jun 1 19:35:21 2012 From: a.janke at gmail.com (Andrew Janke) Date: Sat, 2 Jun 2012 09:35:21 +1000 Subject: [MINC-users] cannot open shared object file In-Reply-To: References: Message-ID: Hi Tanweer, On 2 June 2012 09:31, Tanweer Rashid wrote: > Display: error while loading shared libraries: libvolume_io2.so.1: cannot > open shared object file: No such file or directory > > Any ideas on why I am getting these errors? I am using Ubuntu 12.04 LTS. > I checked and I see that the I already have the libraries libminc2, > libvolume_io2 and libbicpl in the directory /usr/local/lib > The Display and register programs are in /usr/local/bin Have you added: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib to your .bashrc? (and then opened a new terminal window) a From peter.neelin at gmail.com Sun Jun 3 07:45:13 2012 From: peter.neelin at gmail.com (Peter Neelin) Date: Sun, 3 Jun 2012 07:45:13 -0400 Subject: [MINC-users] default slice min/max in mincreshape? In-Reply-To: References: Message-ID: On May 31, 2012 11:53 PM, "Alex Zijdenbos" wrote: > however when I call mincreshape on that volume to pad it, i.e., add > empty slices, the added slices receive a max value of 1; so the > resulting image shows, after adding 5 slices: mincreshape is trying to avoid having a range of zero which could potentially lead to divide by zero situations for less-than-perfect apps reading the output file. Unfortunately, the arbitrary value that it picks is too big for your file. The guilty code is in progs/mincreshape/copy_data.c, function get_block_min_and_max(). There is a block of code in there that sets variable default_extreme to 1.0 for the maximum and 0.0 for the minimum. This could either be changed to a much smaller number (to preserve the original intention), or mincreshape could scan all of the min and max to determine a file-specific default min and max (although you probably don't want to use the global max here - probably 1% of the range or something). Note that the choice of 0.0 for the min could also be a problem for files that have are shifted up and have a narrow range. Anyway, I'll leave it to you guys to figure out how you want to fix this. Peter -- Peter Neelin peter.neelin at gmail.com From a.janke at gmail.com Mon Jun 4 02:32:24 2012 From: a.janke at gmail.com (Andrew Janke) Date: Mon, 4 Jun 2012 16:32:24 +1000 Subject: [MINC-users] default slice min/max in mincreshape? In-Reply-To: References: Message-ID: Hi Peter (and others), Thanks for the pointer. > mincreshape is trying to avoid having a range of zero which could > potentially lead to divide by zero situations for less-than-perfect apps > reading the output file. Unfortunately, the arbitrary value that it picks > is too big for your file. > > The guilty code is in progs/mincreshape/copy_data.c, function > get_block_min_and_max(). There is a block of code in there that sets > variable default_extreme to 1.0 for the maximum and 0.0 for the minimum. > This could either be changed to a much smaller number (to preserve the > original intention), or mincreshape could scan all of the min and max to > determine a file-specific default min and max (although you probably don't > want to use the global max here - probably 1% of the range or something). > Note that the choice of 0.0 for the min could also be a problem for files > that have are shifted up and have a narrow range. I don't think the problem is quite as straight forward as the above (although setting a smaller number will work -- and eventually break somewhere else). The problem seems to be that nothing is defined at the start. If you do this: (first make a file that will break things) mincreshape -dimrange zspace=50,10 /usr/local/bic/share/model.mnc /tmp/10.mnc mincmath -mult -const 0.000001 /tmp/10.mnc /tmp/small.mnc Now reshape: mincreshape -dimrange zspace=0,40 /tmp/small.mnc /tmp/out.mnc mincheader /tmp/out.mnc ... image-min = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; image-max = 1.50176742592221e-11, 1.4706592772461e-11, 1.47731739408916e-11, 1.29191933176351e-11, 1.38217782687002e-11, 1.35282269390157e-11, 1.30565671507807e-11, 1.26761793835777e-11, 1.26660561800091e-11, 1.35031529091316e-11, 1.36272934702302e-11, 1.30031373028565e-11, 1.26079339468883e-11, 1.29919927604189e-11, 1.28181591844077e-11, 1.270971845851e-11, 1.27311934672496e-11, 1.36087412976983e-11, 1.34799824270089e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11 ; Things are fine. Now if you add those same slices on the front: mincreshape -dimrange zspace=-10,40 /tmp/small.mnc /tmp/out.mnc mincheader /tmp/out.mnc ... image-max = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.50176742592221e-11, 1.4706592772461e-11, 1.47731739408916e-11, 1.29191933176351e-11, 1.38217782687002e-11, 1.35282269390157e-11, 1.30565671507807e-11, 1.26761793835777e-11, 1.26660561800091e-11, 1.35031529091316e-11, 1.36272934702302e-11, 1.30031373028565e-11, 1.26079339468883e-11, 1.29919927604189e-11, 1.28181591844077e-11, 1.270971845851e-11, 1.27311934672496e-11, 1.36087412976983e-11, 1.34799824270089e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11, 1.27816067975376e-11 ; Things break. So to me it's a problem with an unitialised variable. The correct fix from what I can see it to scan into the volume looking for the first real block and using the minimum of that. This seems to be what happens for following data but I haven't looked into things long enough to figure out how it picks up the value from the last block. a From jared.rowley at gmail.com Tue Jun 5 16:18:42 2012 From: jared.rowley at gmail.com (Jared Rowley) Date: Tue, 5 Jun 2012 16:18:42 -0400 Subject: [MINC-users] calculating r-squared values Message-ID: Hi Minc Users, I was wondering if anyone knows a way calculate R-squared values on a voxel level from a linear regression. I assume there is a way with either glim_image or RMINC however reading though the documentation I could not find a solution. Thanks very much, Jared From jason at phenogenomics.ca Wed Jun 6 13:35:10 2012 From: jason at phenogenomics.ca (Jason Lerch) Date: Wed, 6 Jun 2012 13:35:10 -0400 Subject: [MINC-users] calculating r-squared values In-Reply-To: References: Message-ID: <505FFB2E-64AD-4383-ADF0-7972F5155FA5@phenogenomics.ca> This should work, though is going to be slow: fff <- function(x) { return(summary(lm(x ~ genotype, gf))$r.squared) } mincApply(filenames, quote(fff(x))) Note: replace the formula in that function with the appropriate formula for your purposes, and filenames should be a vector of your filenames. Could be worth specifying a mask, as this will run for a few hours. And I haven't actually tested it, so it might not run at all! Jason On 2012-06-05, at 4:18 PM, Jared Rowley wrote: > Hi Minc Users, > > I was wondering if anyone knows a way calculate R-squared values on a voxel > level from a linear regression. > > I assume there is a way with either glim_image or RMINC however reading > though the documentation I could not find a solution. > > Thanks very much, > > Jared > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From Jonathan.Berken at mail.mcgill.ca Fri Jun 8 11:15:14 2012 From: Jonathan.Berken at mail.mcgill.ca (Jonathan Berken) Date: Fri, 8 Jun 2012 11:15:14 -0400 Subject: [MINC-users] FDR analysis for cortical thickness Message-ID: Hello, I was wondering if someone who is familiar with FDR analysis for cortical thickness might be able to help me work out the script. Thanks! Jonathan From jason at phenogenomics.ca Fri Jun 8 11:19:30 2012 From: jason at phenogenomics.ca (Jason Lerch) Date: Fri, 8 Jun 2012 11:19:30 -0400 Subject: [MINC-users] FDR analysis for cortical thickness In-Reply-To: References: Message-ID: <86D83A58-DAD8-4898-8DE8-96AF1E980788@phenogenomics.ca> There's an implementation in mni.cortical.statistcs and RMINC as well as Keith's matlab surfstats. The recipe in R: 1) create a vector of p-values 2) qvals <- p.adjust(pvalues, "fdr") Jason On 2012-06-08, at 11:15 AM, Jonathan Berken wrote: > Hello, > > I was wondering if someone who is familiar with FDR analysis for cortical > thickness might be able to help me work out the script. > > Thanks! > > Jonathan > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From jared.rowley at gmail.com Fri Jun 8 11:32:10 2012 From: jared.rowley at gmail.com (Jared Rowley) Date: Fri, 8 Jun 2012 11:32:10 -0400 Subject: [MINC-users] calculating r-squared values In-Reply-To: <505FFB2E-64AD-4383-ADF0-7972F5155FA5@phenogenomics.ca> References: <505FFB2E-64AD-4383-ADF0-7972F5155FA5@phenogenomics.ca> Message-ID: Hi Jason, Thanks for the response. I did the following and got an error do you have any suggestions: rm(list=ls(all=TRUE)) > library(RMINC) > gf1 <- read.csv("dti_gd.csv") > fff <- function(x) { return(summary(lm(FA ~ score, gf1))$r.squared) } > mincApply(gf1$FA, quote(fff(x))) Number of volumes: 91 Volume sizes: 193 229 193 In slice 0 Error in storage.mode(y) <- "double" : invalid to change the storage mode of a factor In addition: Warning message: In model.response(mf, "numeric") : using type="numeric" with a factor response will be ignored FA is a column of minc files and score is a column of integers I want to correlate with FA. Thanks very much, Jared On Wed, Jun 6, 2012 at 1:35 PM, Jason Lerch wrote: > This should work, though is going to be slow: > > fff <- function(x) { return(summary(lm(x ~ genotype, gf))$r.squared) } > > mincApply(filenames, quote(fff(x))) > > Note: replace the formula in that function with the appropriate formula > for your purposes, and filenames should be a vector of your filenames. > Could be worth specifying a mask, as this will run for a few hours. > > And I haven't actually tested it, so it might not run at all! > > Jason > > On 2012-06-05, at 4:18 PM, Jared Rowley wrote: > > > Hi Minc Users, > > > > I was wondering if anyone knows a way calculate R-squared values on a > voxel > > level from a linear regression. > > > > I assume there is a way with either glim_image or RMINC however reading > > though the documentation I could not find a solution. > > > > Thanks very much, > > > > Jared > > _______________________________________________ > > MINC-users at bic.mni.mcgill.ca > > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > -- Jared Rowley Translational Neuroimaging Laboratory McGill Centre for Studies in Aging Douglas Hospital Research Center McGill University 6825 LaSalle Blvd. Montreal, QC Canada H4H 1R3 From francois.hebert007 at gmail.com Fri Jun 8 11:36:01 2012 From: francois.hebert007 at gmail.com (francois hebert) Date: Fri, 8 Jun 2012 11:36:01 -0400 Subject: [MINC-users] Maximum intensity projection Message-ID: Hi All, I would like to do a Maximum Intensity Projection in each orthogonal axis. Is there such tool in the minc library? Regards, Francois Hebert From jason at phenogenomics.ca Fri Jun 8 12:39:28 2012 From: jason at phenogenomics.ca (Jason Lerch) Date: Fri, 8 Jun 2012 12:39:28 -0400 Subject: [MINC-users] calculating r-squared values In-Reply-To: References: Message-ID: Try replacing FA with x - mincApply assigns the current voxel to the variable x in its loop. I.e.: library(RMINC) gf1 <- read.csv("dti_gd.csv") fff <- function(x) { return(summary(lm(x ~ score, gf1))$r.squared) } mincApply(gf1$FA, quote(fff(x))) Jason On 2012-06-08, at 11:32 AM, Jared Rowley wrote: > Hi Jason, > > Thanks for the response. > > I did the following and got an error do you have any suggestions: > > rm(list=ls(all=TRUE)) >> library(RMINC) >> gf1 <- read.csv("dti_gd.csv") >> fff <- function(x) { return(summary(lm(FA ~ score, gf1))$r.squared) } >> mincApply(gf1$FA, quote(fff(x))) > Number of volumes: 91 > Volume sizes: 193 229 193 > In slice > 0 Error in storage.mode(y) <- "double" : > invalid to change the storage mode of a factor > In addition: Warning message: > In model.response(mf, "numeric") : > using type="numeric" with a factor response will be ignored > > FA is a column of minc files and score is a column of integers I want to > correlate with FA. > > Thanks very much, > > Jared > > > On Wed, Jun 6, 2012 at 1:35 PM, Jason Lerch wrote: > >> This should work, though is going to be slow: >> >> fff <- function(x) { return(summary(lm(x ~ genotype, gf))$r.squared) } >> >> mincApply(filenames, quote(fff(x))) >> >> Note: replace the formula in that function with the appropriate formula >> for your purposes, and filenames should be a vector of your filenames. >> Could be worth specifying a mask, as this will run for a few hours. >> >> And I haven't actually tested it, so it might not run at all! >> >> Jason >> >> On 2012-06-05, at 4:18 PM, Jared Rowley wrote: >> >>> Hi Minc Users, >>> >>> I was wondering if anyone knows a way calculate R-squared values on a >> voxel >>> level from a linear regression. >>> >>> I assume there is a way with either glim_image or RMINC however reading >>> though the documentation I could not find a solution. >>> >>> Thanks very much, >>> >>> Jared >>> _______________________________________________ >>> MINC-users at bic.mni.mcgill.ca >>> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >> >> _______________________________________________ >> MINC-users at bic.mni.mcgill.ca >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >> > > > > -- > Jared Rowley > Translational Neuroimaging Laboratory > McGill Centre for Studies in Aging > Douglas Hospital Research Center > McGill University > 6825 LaSalle Blvd. > Montreal, QC Canada > H4H 1R3 > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From jason at phenogenomics.ca Fri Jun 8 12:47:55 2012 From: jason at phenogenomics.ca (Jason Lerch) Date: Fri, 8 Jun 2012 12:47:55 -0400 Subject: [MINC-users] Maximum intensity projection In-Reply-To: References: Message-ID: <029CFFCF-9BEE-4D0C-B9CA-E2884BDEEBAD@phenogenomics.ca> This should do what you want, I think. In python: from pyminc.volumes.factory import * from numpy import * import scipy v = volumeFromFile("filename.mnc") axis0 = apply_along_axis(max, 0, v.data) axis1 = apply_along_axis(max, 1, v.data) axis2 = apply_along_axis(max, 2, v.data) # if you want to save it as an image: scipy.misc.imsave('axis0.jpg', axis0) Jason On 2012-06-08, at 11:36 AM, francois hebert wrote: > Hi All, > > I would like to do a Maximum Intensity Projection in each orthogonal axis. > Is there such tool in the minc library? > > Regards, > > Francois Hebert > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From mishkind at gmail.com Fri Jun 8 14:00:22 2012 From: mishkind at gmail.com (Mishkin Derakhshan) Date: Fri, 8 Jun 2012 14:00:22 -0400 Subject: [MINC-users] FDR analysis for cortical thickness In-Reply-To: <86D83A58-DAD8-4898-8DE8-96AF1E980788@phenogenomics.ca> References: <86D83A58-DAD8-4898-8DE8-96AF1E980788@phenogenomics.ca> Message-ID: Hi Jonathan, At the risk of depriving you hours of endless fun coding this up yourself, attached is my implementation using the mni.cortical.statistics library (which you will need to install). There is quite a bit of documentation on the bic wiki: http://wiki.bic.mni.mcgill.ca/index.php/ThicknessStatistics I'm at wb319 in the bic if you need help. mishkin p.s this is how to install the R library (using a bash shell) if you didn't know: 1. download the mni.cortical.statistics library 2. R CMD INSTALL --library=/path/to/useful/extra/libraries/for/R/ mni.cortical.statistics 3. export R_LIBS=/path/to/useful/extra/libraries/for/R/ On Fri, Jun 8, 2012 at 11:19 AM, Jason Lerch wrote: > There's an implementation in mni.cortical.statistcs and RMINC as well as Keith's matlab surfstats. > > The recipe in R: > > 1) create a vector of p-values > 2) qvals <- p.adjust(pvalues, "fdr") > > Jason > > On 2012-06-08, at 11:15 AM, Jonathan Berken wrote: > >> Hello, >> >> I was wondering if someone who is familiar with FDR analysis for cortical >> thickness might be able to help me work out the script. >> >> Thanks! >> >> Jonathan >> _______________________________________________ >> MINC-users at bic.mni.mcgill.ca >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From mishkind at gmail.com Fri Jun 8 14:35:03 2012 From: mishkind at gmail.com (Mishkin Derakhshan) Date: Fri, 8 Jun 2012 14:35:03 -0400 Subject: [MINC-users] FDR analysis for cortical thickness In-Reply-To: References: <86D83A58-DAD8-4898-8DE8-96AF1E980788@phenogenomics.ca> Message-ID: On Fri, Jun 8, 2012 at 2:06 PM, Jonathan Berken wrote: > Hi Mishkin, > > Thanks so much for your help! > > I already have R library and have ran cortical thickness analyses... I am > just not sure how to run the FDR analysis... I have the script from the > site, but not sure where to get the t-values from my results to input? So if you've ran the cortical thickness analyses, then you should have some t-values for whatever you tested for. In my example script, my array of t-values comes from here: vertexstatistics <- mni.vertex.statistics(glimfile, 'y ~ group', vertex.table=datatable) vertexstatistics contains a lot of different items, the array of t-values are here: vertexstatistics\$tstatistic[,2] The t-values represent the result of a two-tailed t-test for the test y ~ group, which usually means you are testing for differences in cortical thickness (y) in the different groups (ie. francophones vs. anglophones). What 'y' and 'group' actually mean, depend on what you put in your glim file, but if you've ran your analysis already then i have a feeling you know this already. > Can > I run the FDR after I do my initial CT regression? Sorry, but I don't actually know what you mean by initial CT regression? I use MRI data, and I don't actually look for differences in cortical thickness but just use the library for other vertex wise tests that I need. Like Jason said though, the FDR can be calculated on any array of t-values (or pvalues) that are the output of anything you are trying to test for. If you look at the code (in R type: 'library(mni.crotical.statistics)' then 'mni.compute.FDR') you can see that it actually needs p-values, but it can compute those from the given t-stats if you give it the degrees of freedom. > > Jonathan > > On Fri, Jun 8, 2012 at 2:00 PM, Mishkin Derakhshan > wrote: >> >> Hi Jonathan, >> >> At the risk of depriving you hours of endless fun coding this up >> yourself, attached is my implementation using the >> mni.cortical.statistics library (which you will need to install). >> >> There is quite a bit of documentation on the bic wiki: >> http://wiki.bic.mni.mcgill.ca/index.php/ThicknessStatistics >> >> I'm at wb319 in the bic if you need help. >> mishkin >> >> p.s this is how to install the R library (using a bash shell) if you >> didn't know: >> 1. download the mni.cortical.statistics library >> 2. R CMD INSTALL --library=/path/to/useful/extra/libraries/for/R/ >> mni.cortical.statistics >> 3. export R_LIBS=/path/to/useful/extra/libraries/for/R/ >> >> >> On Fri, Jun 8, 2012 at 11:19 AM, Jason Lerch >> wrote: >> > There's an implementation in mni.cortical.statistcs and RMINC as well as >> > Keith's matlab surfstats. >> > >> > The recipe in R: >> > >> > 1) create a vector of p-values >> > 2) qvals <- p.adjust(pvalues, "fdr") >> > >> > Jason >> > >> > On 2012-06-08, at 11:15 AM, Jonathan Berken wrote: >> > >> >> Hello, >> >> >> >> I was wondering if someone who is familiar with FDR analysis for >> >> cortical >> >> thickness might be able to help me work out the script. >> >> >> >> Thanks! >> >> >> >> Jonathan >> >> _______________________________________________ >> >> MINC-users at bic.mni.mcgill.ca >> >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >> > >> > _______________________________________________ >> > MINC-users at bic.mni.mcgill.ca >> > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >> >> _______________________________________________ >> MINC-users at bic.mni.mcgill.ca >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >> > From jonathan.berken at gmail.com Fri Jun 8 14:40:04 2012 From: jonathan.berken at gmail.com (Jonathan Berken) Date: Fri, 8 Jun 2012 14:40:04 -0400 Subject: [MINC-users] FDR analysis for cortical thickness In-Reply-To: References: <86D83A58-DAD8-4898-8DE8-96AF1E980788@phenogenomics.ca> Message-ID: How do I open my list of t-values? On Fri, Jun 8, 2012 at 2:35 PM, Mishkin Derakhshan wrote: > On Fri, Jun 8, 2012 at 2:06 PM, Jonathan Berken > wrote: > > Hi Mishkin, > > > > Thanks so much for your help! > > > > I already have R library and have ran cortical thickness analyses... I am > > just not sure how to run the FDR analysis... I have the script from the > > site, but not sure where to get the t-values from my results to input? > > So if you've ran the cortical thickness analyses, then you should have > some t-values for whatever you tested for. > > In my example script, my array of t-values comes from here: > vertexstatistics <- mni.vertex.statistics(glimfile, 'y ~ group', > vertex.table=datatable) > > vertexstatistics contains a lot of different items, the array of > t-values are here: > vertexstatistics\$tstatistic[,2] > > The t-values represent the result of a two-tailed t-test for the test > y ~ group, which usually means you are testing for differences in > cortical thickness (y) in the different groups (ie. francophones vs. > anglophones). What 'y' and 'group' actually mean, depend on what you > put in your glim file, but if you've ran your analysis already then i > have a feeling you know this already. > > > Can > > I run the FDR after I do my initial CT regression? > > Sorry, but I don't actually know what you mean by initial CT > regression? I use MRI data, and I don't actually look for differences > in cortical thickness but just use the library for other vertex wise > tests that I need. Like Jason said though, the FDR can be calculated > on any array of t-values (or pvalues) that are the output of anything > you are trying to test for. > > If you look at the code (in R type: 'library(mni.crotical.statistics)' > then 'mni.compute.FDR') you can see that it actually needs p-values, > but it can compute those from the given t-stats if you give it the > degrees of freedom. > > > > > Jonathan > > > > On Fri, Jun 8, 2012 at 2:00 PM, Mishkin Derakhshan > > wrote: > >> > >> Hi Jonathan, > >> > >> At the risk of depriving you hours of endless fun coding this up > >> yourself, attached is my implementation using the > >> mni.cortical.statistics library (which you will need to install). > >> > >> There is quite a bit of documentation on the bic wiki: > >> http://wiki.bic.mni.mcgill.ca/index.php/ThicknessStatistics > >> > >> I'm at wb319 in the bic if you need help. > >> mishkin > >> > >> p.s this is how to install the R library (using a bash shell) if you > >> didn't know: > >> 1. download the mni.cortical.statistics library > >> 2. R CMD INSTALL --library=/path/to/useful/extra/libraries/for/R/ > >> mni.cortical.statistics > >> 3. export R_LIBS=/path/to/useful/extra/libraries/for/R/ > >> > >> > >> On Fri, Jun 8, 2012 at 11:19 AM, Jason Lerch > >> wrote: > >> > There's an implementation in mni.cortical.statistcs and RMINC as well > as > >> > Keith's matlab surfstats. > >> > > >> > The recipe in R: > >> > > >> > 1) create a vector of p-values > >> > 2) qvals <- p.adjust(pvalues, "fdr") > >> > > >> > Jason > >> > > >> > On 2012-06-08, at 11:15 AM, Jonathan Berken wrote: > >> > > >> >> Hello, > >> >> > >> >> I was wondering if someone who is familiar with FDR analysis for > >> >> cortical > >> >> thickness might be able to help me work out the script. > >> >> > >> >> Thanks! > >> >> > >> >> Jonathan > >> >> _______________________________________________ > >> >> MINC-users at bic.mni.mcgill.ca > >> >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > >> > > >> > _______________________________________________ > >> > MINC-users at bic.mni.mcgill.ca > >> > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > >> > >> _______________________________________________ > >> MINC-users at bic.mni.mcgill.ca > >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > >> > > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From francois.hebert007 at gmail.com Fri Jun 8 17:05:31 2012 From: francois.hebert007 at gmail.com (francois hebert) Date: Fri, 8 Jun 2012 17:05:31 -0400 Subject: [MINC-users] Maximum intensity projection In-Reply-To: <029CFFCF-9BEE-4D0C-B9CA-E2884BDEEBAD@phenogenomics.ca> References: <029CFFCF-9BEE-4D0C-B9CA-E2884BDEEBAD@phenogenomics.ca> Message-ID: Hello Jason, It has worked perfectly, I just want to say that pyminc seems very easy to use. Thanks a lot 2012/6/8 Jason Lerch > This should do what you want, I think. In python: > > from pyminc.volumes.factory import * > from numpy import * > import scipy > > v = volumeFromFile("filename.mnc") > axis0 = apply_along_axis(max, 0, v.data) > axis1 = apply_along_axis(max, 1, v.data) > axis2 = apply_along_axis(max, 2, v.data) > > # if you want to save it as an image: > scipy.misc.imsave('axis0.jpg', axis0) > > Jason > > On 2012-06-08, at 11:36 AM, francois hebert wrote: > > > Hi All, > > > > I would like to do a Maximum Intensity Projection in each orthogonal > axis. > > Is there such tool in the minc library? > > > > Regards, > > > > Francois Hebert > > _______________________________________________ > > MINC-users at bic.mni.mcgill.ca > > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From kelvin.mok at mcgill.ca Fri Jun 8 18:01:42 2012 From: kelvin.mok at mcgill.ca (Kelvin Mok) Date: Fri, 8 Jun 2012 18:01:42 -0400 Subject: [MINC-users] FDR analysis for cortical thickness In-Reply-To: References: <86D83A58-DAD8-4898-8DE8-96AF1E980788@phenogenomics.ca> Message-ID: <4FD27646.7010702@mcgill.ca> Hey Jonathan, Mishkin mentioned it below, but your t-stats can be loaded with: (assuming that you have analyzed your data in your R session, or you used --save option) vs$tstatistic[0,] (your script uses the variable name "vs" ) This will spit out the variables where we have t-statistics (ie Intercept, Variable1, Variable2, Interaction1:2), then you can choose the corresponding column: vs$tstatistic[,1] (i.e, Intercept) vs$tstatistic[,2] (i.e. Variable1) vs$tstatistic[,3] (i.e. Variable2) Since we're already using Jason's stats library, we can send the column of t-statistics values directly into his FDR function, mni.compute.FDR. qvalues<-mni.compute.FDR(*t.stats=vs$tstatistics,column.name=column#*,df=_inputdegoffreedom__,fdr=0.05) Then, the false discovery rate value would be here: qvalues$fdr.threshold We just made an error in your script defining the t.stats variable. Kelvin On 2012-06-08, at 2:40 PM, Jonathan Berken wrote: > How do I open my list of t-values? > > On Fri, Jun 8, 2012 at 2:35 PM, Mishkin Derakhshan >wrote: > >> On Fri, Jun 8, 2012 at 2:06 PM, Jonathan Berken >> > wrote: >>> Hi Mishkin, >>> >>> Thanks so much for your help! >>> >>> I already have R library and have ran cortical thickness analyses... >>> I am >>> just not sure how to run the FDR analysis... I have the script from the >>> site, but not sure where to get the t-values from my results to input? >> >> So if you've ran the cortical thickness analyses, then you should have >> some t-values for whatever you tested for. >> >> In my example script, my array of t-values comes from here: >> vertexstatistics <- mni.vertex.statistics(glimfile, 'y ~ group', >> vertex.table=datatable) >> >> vertexstatistics contains a lot of different items, the array of >> t-values are here: >> vertexstatistics\$tstatistic[,2] >> >> The t-values represent the result of a two-tailed t-test for the test >> y ~ group, which usually means you are testing for differences in >> cortical thickness (y) in the different groups (ie. francophones vs. >> anglophones). What 'y' and 'group' actually mean, depend on what you >> put in your glim file, but if you've ran your analysis already then i >> have a feeling you know this already. >> >>> Can >>> I run the FDR after I do my initial CT regression? >> >> Sorry, but I don't actually know what you mean by initial CT >> regression? I use MRI data, and I don't actually look for differences >> in cortical thickness but just use the library for other vertex wise >> tests that I need. Like Jason said though, the FDR can be calculated >> on any array of t-values (or pvalues) that are the output of anything >> you are trying to test for. >> >> If you look at the code (in R type: 'library(mni.crotical.statistics)' >> then 'mni.compute.FDR') you can see that it actually needs p-values, >> but it can compute those from the given t-stats if you give it the >> degrees of freedom. >> >>> >>> Jonathan >>> >>> On Fri, Jun 8, 2012 at 2:00 PM, Mishkin Derakhshan >>> > >>> wrote: >>>> >>>> Hi Jonathan, >>>> >>>> At the risk of depriving you hours of endless fun coding this up >>>> yourself, attached is my implementation using the >>>> mni.cortical.statistics library (which you will need to install). >>>> >>>> There is quite a bit of documentation on the bic wiki: >>>> http://wiki.bic.mni.mcgill.ca/index.php/ThicknessStatistics >>>> >>>> I'm at wb319 in the bic if you need help. >>>> mishkin >>>> >>>> p.s this is how to install the R library (using a bash shell) if you >>>> didn't know: >>>> 1. download the mni.cortical.statistics library >>>> 2. R CMD INSTALL --library=/path/to/useful/extra/libraries/for/R/ >>>> mni.cortical.statistics >>>> 3. export R_LIBS=/path/to/useful/extra/libraries/for/R/ >>>> >>>> >>>> On Fri, Jun 8, 2012 at 11:19 AM, Jason Lerch >>>> > >>>> wrote: >>>>> There's an implementation in mni.cortical.statistcs and RMINC as well >> as >>>>> Keith's matlab surfstats. >>>>> >>>>> The recipe in R: >>>>> >>>>> 1) create a vector of p-values >>>>> 2) qvals <- p.adjust(pvalues, "fdr") >>>>> >>>>> Jason >>>>> >>>>> On 2012-06-08, at 11:15 AM, Jonathan Berken wrote: >>>>> >>>>>> Hello, >>>>>> >>>>>> I was wondering if someone who is familiar with FDR analysis for >>>>>> cortical >>>>>> thickness might be able to help me work out the script. >>>>>> >>>>>> Thanks! >>>>>> >>>>>> Jonathan >>>>>> _______________________________________________ >>>>>> MINC-users at bic.mni.mcgill.ca >>>>>> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >>>>> >>>>> _______________________________________________ >>>>> MINC-users at bic.mni.mcgill.ca >>>>> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >>>> >>>> _______________________________________________ >>>> MINC-users at bic.mni.mcgill.ca >>>> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >>>> >>> >> _______________________________________________ >> MINC-users at bic.mni.mcgill.ca >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >> > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From jared.rowley at gmail.com Mon Jun 11 10:25:12 2012 From: jared.rowley at gmail.com (Jared Rowley) Date: Mon, 11 Jun 2012 10:25:12 -0400 Subject: [MINC-users] calculating r-squared values In-Reply-To: References: <505FFB2E-64AD-4383-ADF0-7972F5155FA5@phenogenomics.ca> Message-ID: Hi Jason, Everything appeared to work however I'm a little unclear how to save the data now. (It does take a very long time to run). Here is my code. The last line was my attempt to save the data: gf1 <- read.csv("dti_nvm_gd.csv") > fff <- function(x) { return(summary(lm(x ~ score, gf1))$r.squared) } > mincApply(gf1$FA, quote(fff(x))) Number of volumes: 91 Volume sizes: 193 229 193 In slice 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 Done > mincWriteVolume(fff,"rsquared_test.mnc", "score") Error in minc.dimensions.sizes(like.filename) : Error opening input file: score. Thanks again, Jared On Fri, Jun 8, 2012 at 12:39 PM, Jason Lerch wrote: > Try replacing FA with x - mincApply assigns the current voxel to the > variable x in its loop. I.e.: > > library(RMINC) > gf1 <- read.csv("dti_gd.csv") > fff <- function(x) { return(summary(lm(x ~ score, gf1))$r.squared) } > mincApply(gf1$FA, quote(fff(x))) > > Jason > > On 2012-06-08, at 11:32 AM, Jared Rowley wrote: > > > Hi Jason, > > > > Thanks for the response. > > > > I did the following and got an error do you have any suggestions: > > > > rm(list=ls(all=TRUE)) > >> library(RMINC) > >> gf1 <- read.csv("dti_gd.csv") > >> fff <- function(x) { return(summary(lm(FA ~ score, gf1))$r.squared) } > >> mincApply(gf1$FA, quote(fff(x))) > > Number of volumes: 91 > > Volume sizes: 193 229 193 > > In slice > > 0 Error in storage.mode(y) <- "double" : > > invalid to change the storage mode of a factor > > In addition: Warning message: > > In model.response(mf, "numeric") : > > using type="numeric" with a factor response will be ignored > > > > FA is a column of minc files and score is a column of integers I want to > > correlate with FA. > > > > Thanks very much, > > > > Jared > > > > > > On Wed, Jun 6, 2012 at 1:35 PM, Jason Lerch > wrote: > > > >> This should work, though is going to be slow: > >> > >> fff <- function(x) { return(summary(lm(x ~ genotype, gf))$r.squared) } > >> > >> mincApply(filenames, quote(fff(x))) > >> > >> Note: replace the formula in that function with the appropriate formula > >> for your purposes, and filenames should be a vector of your filenames. > >> Could be worth specifying a mask, as this will run for a few hours. > >> > >> And I haven't actually tested it, so it might not run at all! > >> > >> Jason > >> > >> On 2012-06-05, at 4:18 PM, Jared Rowley wrote: > >> > >>> Hi Minc Users, > >>> > >>> I was wondering if anyone knows a way calculate R-squared values on a > >> voxel > >>> level from a linear regression. > >>> > >>> I assume there is a way with either glim_image or RMINC however reading > >>> though the documentation I could not find a solution. > >>> > >>> Thanks very much, > >>> > >>> Jared > >>> _______________________________________________ > >>> MINC-users at bic.mni.mcgill.ca > >>> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > >> > >> _______________________________________________ > >> MINC-users at bic.mni.mcgill.ca > >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > >> > > > > > > > > -- > > Jared Rowley > > Translational Neuroimaging Laboratory > > McGill Centre for Studies in Aging > > Douglas Hospital Research Center > > McGill University > > 6825 LaSalle Blvd. > > Montreal, QC Canada > > H4H 1R3 > > _______________________________________________ > > MINC-users at bic.mni.mcgill.ca > > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > -- Jared Rowley Translational Neuroimaging Laboratory McGill Centre for Studies in Aging Douglas Hospital Research Center McGill University 6825 LaSalle Blvd. Montreal, QC Canada H4H 1R3 From jason at phenogenomics.ca Mon Jun 11 11:07:18 2012 From: jason at phenogenomics.ca (Jason Lerch) Date: Mon, 11 Jun 2012 11:07:18 -0400 Subject: [MINC-users] calculating r-squared values In-Reply-To: References: Message-ID: <247716CD-CFBC-4883-B16C-748F1D6B5208@phenogenomics.ca> You have to save your output to a variable: output <- mincApply(gf1$FA, quote(fff(x))) and then call mincWriteVolume(output, "filename.mnc") If you didn't do that, the internal R variable .Last.value would have saved your last computation - though if you did anything else since then (and the mincWriteVolume call might apply, I'm not sure), then you'll have to rerun mincApply and assign its output to some variable. Jason On 2012-06-11, at 10:25 AM, Jared Rowley wrote: > Hi Jason, > > Everything appeared to work however I'm a little unclear how to save the > data now. (It does take a very long time to run). > > Here is my code. The last line was my attempt to save the data: > > gf1 <- read.csv("dti_nvm_gd.csv") >> fff <- function(x) { return(summary(lm(x ~ score, gf1))$r.squared) } >> mincApply(gf1$FA, quote(fff(x))) > Number of volumes: 91 > Volume sizes: 193 229 193 > In slice > 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 > 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 > 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 > 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 > 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 > 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 > 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 > 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 > 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 > 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 > 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 > 187 188 189 190 191 192 > Done > >> mincWriteVolume(fff,"rsquared_test.mnc", "score") > Error in minc.dimensions.sizes(like.filename) : > Error opening input file: score. > > Thanks again, > > Jared > > > On Fri, Jun 8, 2012 at 12:39 PM, Jason Lerch wrote: > >> Try replacing FA with x - mincApply assigns the current voxel to the >> variable x in its loop. I.e.: >> >> library(RMINC) >> gf1 <- read.csv("dti_gd.csv") >> fff <- function(x) { return(summary(lm(x ~ score, gf1))$r.squared) } >> mincApply(gf1$FA, quote(fff(x))) >> >> Jason >> >> On 2012-06-08, at 11:32 AM, Jared Rowley wrote: >> >>> Hi Jason, >>> >>> Thanks for the response. >>> >>> I did the following and got an error do you have any suggestions: >>> >>> rm(list=ls(all=TRUE)) >>>> library(RMINC) >>>> gf1 <- read.csv("dti_gd.csv") >>>> fff <- function(x) { return(summary(lm(FA ~ score, gf1))$r.squared) } >>>> mincApply(gf1$FA, quote(fff(x))) >>> Number of volumes: 91 >>> Volume sizes: 193 229 193 >>> In slice >>> 0 Error in storage.mode(y) <- "double" : >>> invalid to change the storage mode of a factor >>> In addition: Warning message: >>> In model.response(mf, "numeric") : >>> using type="numeric" with a factor response will be ignored >>> >>> FA is a column of minc files and score is a column of integers I want to >>> correlate with FA. >>> >>> Thanks very much, >>> >>> Jared >>> >>> >>> On Wed, Jun 6, 2012 at 1:35 PM, Jason Lerch >> wrote: >>> >>>> This should work, though is going to be slow: >>>> >>>> fff <- function(x) { return(summary(lm(x ~ genotype, gf))$r.squared) } >>>> >>>> mincApply(filenames, quote(fff(x))) >>>> >>>> Note: replace the formula in that function with the appropriate formula >>>> for your purposes, and filenames should be a vector of your filenames. >>>> Could be worth specifying a mask, as this will run for a few hours. >>>> >>>> And I haven't actually tested it, so it might not run at all! >>>> >>>> Jason >>>> >>>> On 2012-06-05, at 4:18 PM, Jared Rowley wrote: >>>> >>>>> Hi Minc Users, >>>>> >>>>> I was wondering if anyone knows a way calculate R-squared values on a >>>> voxel >>>>> level from a linear regression. >>>>> >>>>> I assume there is a way with either glim_image or RMINC however reading >>>>> though the documentation I could not find a solution. >>>>> >>>>> Thanks very much, >>>>> >>>>> Jared >>>>> _______________________________________________ >>>>> MINC-users at bic.mni.mcgill.ca >>>>> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >>>> >>>> _______________________________________________ >>>> MINC-users at bic.mni.mcgill.ca >>>> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >>>> >>> >>> >>> >>> -- >>> Jared Rowley >>> Translational Neuroimaging Laboratory >>> McGill Centre for Studies in Aging >>> Douglas Hospital Research Center >>> McGill University >>> 6825 LaSalle Blvd. >>> Montreal, QC Canada >>> H4H 1R3 >>> _______________________________________________ >>> MINC-users at bic.mni.mcgill.ca >>> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >> >> _______________________________________________ >> MINC-users at bic.mni.mcgill.ca >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >> > > > > -- > Jared Rowley > Translational Neuroimaging Laboratory > McGill Centre for Studies in Aging > Douglas Hospital Research Center > McGill University > 6825 LaSalle Blvd. > Montreal, QC Canada > H4H 1R3 > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From jared.rowley at gmail.com Mon Jun 11 11:10:26 2012 From: jared.rowley at gmail.com (Jared Rowley) Date: Mon, 11 Jun 2012 11:10:26 -0400 Subject: [MINC-users] calculating r-squared values In-Reply-To: <247716CD-CFBC-4883-B16C-748F1D6B5208@phenogenomics.ca> References: <505FFB2E-64AD-4383-ADF0-7972F5155FA5@phenogenomics.ca> <247716CD-CFBC-4883-B16C-748F1D6B5208@phenogenomics.ca> Message-ID: Got it. That makes sense. Thanks very much for the help, Jared On Mon, Jun 11, 2012 at 11:07 AM, Jason Lerch wrote: > You have to save your output to a variable: > > output <- mincApply(gf1$FA, quote(fff(x))) > > and then call mincWriteVolume(output, "filename.mnc") > > If you didn't do that, the internal R variable .Last.value would have > saved your last computation - though if you did anything else since then > (and the mincWriteVolume call might apply, I'm not sure), then you'll have > to rerun mincApply and assign its output to some variable. > > Jason > > On 2012-06-11, at 10:25 AM, Jared Rowley wrote: > > > Hi Jason, > > > > Everything appeared to work however I'm a little unclear how to save the > > data now. (It does take a very long time to run). > > > > Here is my code. The last line was my attempt to save the data: > > > > gf1 <- read.csv("dti_nvm_gd.csv") > >> fff <- function(x) { return(summary(lm(x ~ score, gf1))$r.squared) } > >> mincApply(gf1$FA, quote(fff(x))) > > Number of volumes: 91 > > Volume sizes: 193 229 193 > > In slice > > 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 > > 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 > 39 > > 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 > 58 > > 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 > 77 > > 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 > 96 > > 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 > > 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 > > 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 > > 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 > > 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 > > 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 > > 187 188 189 190 191 192 > > Done > > > >> mincWriteVolume(fff,"rsquared_test.mnc", "score") > > Error in minc.dimensions.sizes(like.filename) : > > Error opening input file: score. > > > > Thanks again, > > > > Jared > > > > > > On Fri, Jun 8, 2012 at 12:39 PM, Jason Lerch > wrote: > > > >> Try replacing FA with x - mincApply assigns the current voxel to the > >> variable x in its loop. I.e.: > >> > >> library(RMINC) > >> gf1 <- read.csv("dti_gd.csv") > >> fff <- function(x) { return(summary(lm(x ~ score, gf1))$r.squared) } > >> mincApply(gf1$FA, quote(fff(x))) > >> > >> Jason > >> > >> On 2012-06-08, at 11:32 AM, Jared Rowley wrote: > >> > >>> Hi Jason, > >>> > >>> Thanks for the response. > >>> > >>> I did the following and got an error do you have any suggestions: > >>> > >>> rm(list=ls(all=TRUE)) > >>>> library(RMINC) > >>>> gf1 <- read.csv("dti_gd.csv") > >>>> fff <- function(x) { return(summary(lm(FA ~ score, gf1))$r.squared) } > >>>> mincApply(gf1$FA, quote(fff(x))) > >>> Number of volumes: 91 > >>> Volume sizes: 193 229 193 > >>> In slice > >>> 0 Error in storage.mode(y) <- "double" : > >>> invalid to change the storage mode of a factor > >>> In addition: Warning message: > >>> In model.response(mf, "numeric") : > >>> using type="numeric" with a factor response will be ignored > >>> > >>> FA is a column of minc files and score is a column of integers I want > to > >>> correlate with FA. > >>> > >>> Thanks very much, > >>> > >>> Jared > >>> > >>> > >>> On Wed, Jun 6, 2012 at 1:35 PM, Jason Lerch > >> wrote: > >>> > >>>> This should work, though is going to be slow: > >>>> > >>>> fff <- function(x) { return(summary(lm(x ~ genotype, gf))$r.squared) } > >>>> > >>>> mincApply(filenames, quote(fff(x))) > >>>> > >>>> Note: replace the formula in that function with the appropriate > formula > >>>> for your purposes, and filenames should be a vector of your filenames. > >>>> Could be worth specifying a mask, as this will run for a few hours. > >>>> > >>>> And I haven't actually tested it, so it might not run at all! > >>>> > >>>> Jason > >>>> > >>>> On 2012-06-05, at 4:18 PM, Jared Rowley wrote: > >>>> > >>>>> Hi Minc Users, > >>>>> > >>>>> I was wondering if anyone knows a way calculate R-squared values on a > >>>> voxel > >>>>> level from a linear regression. > >>>>> > >>>>> I assume there is a way with either glim_image or RMINC however > reading > >>>>> though the documentation I could not find a solution. > >>>>> > >>>>> Thanks very much, > >>>>> > >>>>> Jared > >>>>> _______________________________________________ > >>>>> MINC-users at bic.mni.mcgill.ca > >>>>> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > >>>> > >>>> _______________________________________________ > >>>> MINC-users at bic.mni.mcgill.ca > >>>> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > >>>> > >>> > >>> > >>> > >>> -- > >>> Jared Rowley > >>> Translational Neuroimaging Laboratory > >>> McGill Centre for Studies in Aging > >>> Douglas Hospital Research Center > >>> McGill University > >>> 6825 LaSalle Blvd. > >>> Montreal, QC Canada > >>> H4H 1R3 > >>> _______________________________________________ > >>> MINC-users at bic.mni.mcgill.ca > >>> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > >> > >> _______________________________________________ > >> MINC-users at bic.mni.mcgill.ca > >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > >> > > > > > > > > -- > > Jared Rowley > > Translational Neuroimaging Laboratory > > McGill Centre for Studies in Aging > > Douglas Hospital Research Center > > McGill University > > 6825 LaSalle Blvd. > > Montreal, QC Canada > > H4H 1R3 > > _______________________________________________ > > MINC-users at bic.mni.mcgill.ca > > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > -- Jared Rowley Translational Neuroimaging Laboratory McGill Centre for Studies in Aging Douglas Hospital Research Center McGill University 6825 LaSalle Blvd. Montreal, QC Canada H4H 1R3 From a.janke at gmail.com Wed Jun 13 22:00:44 2012 From: a.janke at gmail.com (Andrew Janke) Date: Thu, 14 Jun 2012 12:00:44 +1000 Subject: [MINC-users] Maximum intensity projection In-Reply-To: References: Message-ID: Hi Francois, On 9 June 2012 01:36, francois hebert wrote: > I would like to do a Maximum Intensity Projection in each orthogonal axis. > Is there such tool in the minc library? I know I'm late to party but for the dinosaurs amongst us who don't always play with the new toys you could do this using the basic MINC commands like this (via a perl script): #! /usr/bin/env perl use warnings "all"; # create tmp dir $tmpdir = '/tmp/froogle'; &do_cmd('mkdir', '-p', $tmpdir); # separate all the slices for ($i=0; $i<100; $i++){ &do_cmd('mincreshape', '-clobber', '-dimrange', "zspace=$i,0", $ARGV[0], "$tmpdir/$i-zslice.mnc"); push(@files, "$tmpdir/$i-zslice.mnc"); } &do_cmd('mincmath', '-clobber', '-max', @files, @ARGV[1]); &do_cmd('rm', '-rf', $tmpdir); sub do_cmd { print STDOUT "@_\n"; system(@_) == 0 or die; } I will admit that doing this in pyminc is whole lot easier! a From ayman.oweida at mail.mcgill.ca Thu Jun 14 17:15:19 2012 From: ayman.oweida at mail.mcgill.ca (Ayman Oweida) Date: Thu, 14 Jun 2012 21:15:19 +0000 Subject: [MINC-users] Display bug? Message-ID: <790582915299864F9DC262BDDC538DF515CF3B@EXMBX2010-2.campus.MCGILL.CA> Hi, When I launch Display, I get the 3D volume correctly, but the menu tab doesn't load correctly. It's either all white or contains a partial load of the 3D volume. Any insights on fixing this? Thanks Ayman Oweida, MSc PhD Candidate McGill University Department of Experimental Medicine Montreal General Hospital 1650 Cedar Ave, L5-112 Montreal, QC H3G 1A4 (514) 934-1934 x. 43019 From peter.neelin at gmail.com Fri Jun 15 00:56:29 2012 From: peter.neelin at gmail.com (Peter Neelin) Date: Fri, 15 Jun 2012 00:56:29 -0400 Subject: [MINC-users] Maximum intensity projection In-Reply-To: References: Message-ID: On Jun 13, 2012 10:02 PM, "Andrew Janke" wrote: > On 9 June 2012 01:36, francois hebert wrote: > > I would like to do a Maximum Intensity Projection in each orthogonal axis. > > Is there such tool in the minc library? > > I know I'm late to party but for the dinosaurs amongst us who don't > always play with the new toys you could do this using the basic MINC > commands like this (via a perl script): > [fancy perl script deleted] > &do_cmd('mincmath', '-clobber', '-max', @files, @ARGV[1]); > > I will admit that doing this in pyminc is whole lot easier! Wouldn't a -dimension option to mincmath do the same thing but in one line? I haven't tested it, so I'm not sure if it will allow accumulating the maximum over image dimensions (the original question was for all 3 orthogonal projections). If it does not, then a mincreshape to re-order the dimensions and a mincmath -dimension should do the trick for the other 2 dimensions. Peter -- Peter Neelin peter.neelin at gmail.com From trash001 at odu.edu Fri Jun 15 22:51:45 2012 From: trash001 at odu.edu (Tanweer Rashid) Date: Fri, 15 Jun 2012 22:51:45 -0400 Subject: [MINC-users] Minc installation problem Message-ID: Hi, I am getting some errors when I try to build MINC 2.0.18 from source. I am using Ubuntu 12.04 LTS. I executed ./configure and it seems to work fine, no errors here. Then when I execute make I get the following errors: trash001 at MSVEDE09:~/Downloads/minc-2.0.18$ make make all-recursive make[1]: Entering directory `/home/trash001/Downloads/minc-2.0.18' Making all in . make[2]: Entering directory `/home/trash001/Downloads/minc-2.0.18' depbase=`echo libsrc/image_conversion.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\ /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./libsrc -I./volume_io/Include -I./volume_io/Include -I./progs/Proglib -I./conversion/Acr_nema -I./libsrc2 -g -O2 -MT libsrc/image_conversion.lo -MD -MP -MF $depbase.Tpo -c -o libsrc/image_conversion.lo libsrc/image_conversion.c &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./libsrc -I./volume_io/Include -I./volume_io/Include -I./progs/Proglib -I./conversion/Acr_nema -I./libsrc2 -g -O2 -MT libsrc/image_conversion.lo -MD -MP -MF libsrc/.deps/image_conversion.Tpo -c libsrc/image_conversion.c -o libsrc/image_conversion.o libsrc/image_conversion.c: In function ?miicv_create?: libsrc/image_conversion.c:219:43: error: ?MAX_NC_OPEN? undeclared (first use in this function) libsrc/image_conversion.c:219:43: note: each undeclared identifier is reported only once for each function it appears in make[2]: *** [libsrc/image_conversion.lo] Error 1 make[2]: Leaving directory `/home/trash001/Downloads/minc-2.0.18' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/trash001/Downloads/minc-2.0.18' make: *** [all] Error 2 trash001 at MSVEDE09:~/Downloads/minc-2.0.18$ As far as I know, I have installed all the prerequisite packages, but any suggestions are welcome. Thanks very much. -- Tanweer Rashid MSVE Dept. Old Dominion University From vladimir.fonov at gmail.com Sat Jun 16 00:27:40 2012 From: vladimir.fonov at gmail.com (Vladimir S. Fonov) Date: Sat, 16 Jun 2012 12:27:40 +0800 Subject: [MINC-users] Minc installation problem In-Reply-To: References: Message-ID: <4FDC0B3C.5040701@gmail.com> Hello Tandweer, try using later version of MINC from https://github.com/BIC-MNI/minc ( I suggest release 2.1.12 ( https://github.com/BIC-MNI/minc/tarball/release-2.1.12 ) On 16/06/2012 10:51 AM, Tanweer Rashid wrote: > Hi, I am getting some errors when I try to build MINC 2.0.18 from source. I > am using Ubuntu 12.04 LTS. I executed ./configure and it seems to work > fine, no errors here. Then when I execute make I get the following errors: -- Best regards, Vladimir S. Fonov ~ vladimir fonov gmail com From a.janke at gmail.com Sun Jun 17 00:08:46 2012 From: a.janke at gmail.com (Andrew Janke) Date: Sun, 17 Jun 2012 14:08:46 +1000 Subject: [MINC-users] Display bug? In-Reply-To: <790582915299864F9DC262BDDC538DF515CF3B@EXMBX2010-2.campus.MCGILL.CA> References: <790582915299864F9DC262BDDC538DF515CF3B@EXMBX2010-2.campus.MCGILL.CA> Message-ID: Hi Ayman, There have been a few issues with the latest version of freeglut on various OS's as of late. Unfortunately nothing seems all that consistent as of yet. Which version and which OS are you running on? It'd also help if you could upload a screen shot of this somewhere or send it to me directly. ta a On 15 June 2012 07:15, Ayman Oweida wrote: > Hi, > > When I launch Display, I get the 3D volume correctly, but the menu tab doesn't load correctly. ?It's either all white or contains a partial load of the 3D volume. > > Any insights on fixing this? > > Thanks > > Ayman Oweida, MSc > PhD Candidate > McGill University > Department of Experimental Medicine > > Montreal General Hospital > 1650 Cedar Ave, L5-112 > Montreal, QC ?H3G 1A4 > (514) 934-1934 x. 43019 > > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From jared.rowley at gmail.com Sun Jun 17 00:28:43 2012 From: jared.rowley at gmail.com (Jared Rowley) Date: Sun, 17 Jun 2012 00:28:43 -0400 Subject: [MINC-users] Display bug? In-Reply-To: <790582915299864F9DC262BDDC538DF515CF3B@EXMBX2010-2.campus.MCGILL.CA> References: <790582915299864F9DC262BDDC538DF515CF3B@EXMBX2010-2.campus.MCGILL.CA> Message-ID: <9164249604016312743@unknownmsgid> Hi, So this is probably a stupid answer but I get a problem loading the menu on Display on Mac os x lion sometimes (menu is all white). I can solve the problem by enlarging the menu with the mouse and then shrinking it again. Jared On Jun 14, 2012, at 5:16 PM, Ayman Oweida wrote: > Hi, > > When I launch Display, I get the 3D volume correctly, but the menu tab doesn't load correctly. It's either all white or contains a partial load of the 3D volume. > > Any insights on fixing this? > > Thanks > > Ayman Oweida, MSc > PhD Candidate > McGill University > Department of Experimental Medicine > > Montreal General Hospital > 1650 Cedar Ave, L5-112 > Montreal, QC H3G 1A4 > (514) 934-1934 x. 43019 > > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From ayman.oweida at mail.mcgill.ca Mon Jun 18 09:51:04 2012 From: ayman.oweida at mail.mcgill.ca (Ayman Oweida) Date: Mon, 18 Jun 2012 13:51:04 +0000 Subject: [MINC-users] Display bug? In-Reply-To: <9164249604016312743@unknownmsgid> References: <790582915299864F9DC262BDDC538DF515CF3B@EXMBX2010-2.campus.MCGILL.CA> <9164249604016312743@unknownmsgid> Message-ID: <790582915299864F9DC262BDDC538DF515F6D2@EXMBX2010-2.campus.MCGILL.CA> It solved my problem :) Now, I feel stupid for not having thought of this solution ;) Thanks, Ayman -----Original Message----- From: minc-users-bounces at bic.mni.mcgill.ca [mailto:minc-users-bounces at bic.mni.mcgill.ca] On Behalf Of Jared Rowley Sent: Sunday, June 17, 2012 12:29 AM To: MINC users mailing list Subject: Re: [MINC-users] Display bug? Hi, So this is probably a stupid answer but I get a problem loading the menu on Display on Mac os x lion sometimes (menu is all white). I can solve the problem by enlarging the menu with the mouse and then shrinking it again. Jared On Jun 14, 2012, at 5:16 PM, Ayman Oweida wrote: > Hi, > > When I launch Display, I get the 3D volume correctly, but the menu tab doesn't load correctly. It's either all white or contains a partial load of the 3D volume. > > Any insights on fixing this? > > Thanks > > Ayman Oweida, MSc > PhD Candidate > McGill University > Department of Experimental Medicine > > Montreal General Hospital > 1650 Cedar Ave, L5-112 > Montreal, QC H3G 1A4 > (514) 934-1934 x. 43019 > > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users _______________________________________________ MINC-users at bic.mni.mcgill.ca http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users ----- No virus found in this message. Checked by AVG - www.avg.com Version: 2012.0.2180 / Virus Database: 2433/5076 - Release Date: 06/17/12 From ayman.oweida at mail.mcgill.ca Mon Jun 18 11:23:07 2012 From: ayman.oweida at mail.mcgill.ca (Ayman Oweida) Date: Mon, 18 Jun 2012 15:23:07 +0000 Subject: [MINC-users] mni_autoreg volume Message-ID: <790582915299864F9DC262BDDC538DF515F95B@EXMBX2010-2.campus.MCGILL.CA> Where can I get the MNI reference MR brain volume? I'd like to use it with mni_autoreg. I tried the link below, but to no avail. ftp://ftp.bic.mni.mcgill.ca/pub/mni_autoreg/mni_autoreg_model-1.01.tar.gz I obtained the above link from the page below....is there and updated page? http://www.bic.mni.mcgill.ca/users/louis/MNI_AUTOREG_home/readme/node3.html Thanks, Ayman From eskild at gmail.com Mon Jun 18 13:52:06 2012 From: eskild at gmail.com (Simon Eskildsen) Date: Mon, 18 Jun 2012 19:52:06 +0200 Subject: [MINC-users] mni_autoreg volume In-Reply-To: <790582915299864F9DC262BDDC538DF515F95B@EXMBX2010-2.campus.MCGILL.CA> References: <790582915299864F9DC262BDDC538DF515F95B@EXMBX2010-2.campus.MCGILL.CA> Message-ID: Hi Ayman, You can get the most recent public templates here: http://www.bic.mni.mcgill.ca/ServicesAtlases/ICBM152NLin2009 Simon On Mon, Jun 18, 2012 at 5:23 PM, Ayman Oweida wrote: > Where can I get the MNI reference MR brain volume? I'd like to use it with mni_autoreg. > I tried the link below, but to no avail. > ftp://ftp.bic.mni.mcgill.ca/pub/mni_autoreg/mni_autoreg_model-1.01.tar.gz > > I obtained the above link from the page below....is there and updated page? > http://www.bic.mni.mcgill.ca/users/louis/MNI_AUTOREG_home/readme/node3.html > > > Thanks, > Ayman > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From andrew at biospective.com Tue Jun 19 17:58:07 2012 From: andrew at biospective.com (Andrew Wood) Date: Tue, 19 Jun 2012 17:58:07 -0400 Subject: [MINC-users] Building minc-2.1.12 Message-ID: Hi All, I downloaded minc-2.1.12.tar.gz from github.com/BIC-MNI/minc/downloads and I'm trying to build it. It didn't come with a configure script, so I'm wondering if this might not be an actual release. I generated a configure script with autotools, but the next failure was missing "gram.h" in minccalc. Is there somewhere else I should be looking for the latest release? Thanks, Andrew From a.janke at gmail.com Tue Jun 19 18:49:57 2012 From: a.janke at gmail.com (Andrew Janke) Date: Wed, 20 Jun 2012 08:49:57 +1000 Subject: [MINC-users] Building minc-2.1.12 In-Reply-To: References: Message-ID: Hi Andrew, > I downloaded minc-2.1.12.tar.gz from github.com/BIC-MNI/minc/downloads > and I'm trying to build it. It didn't come with a configure script, so > I'm wondering if this might not be an actual release. I generated a > configure script with autotools, but the next failure was missing > "gram.h" in minccalc. Is there somewhere else I should be looking for > the latest release? If you are building from github as opposd from a release from packages.bic.mni.mcigill.ca you will first need to run: $ ./autogen.sh In the base MINC directory. This will generate you a configure script that you can then run. You can also bild MINC with Cmake if you are that way inclined. a From andrew at biospective.com Wed Jun 20 10:18:18 2012 From: andrew at biospective.com (Andrew Wood) Date: Wed, 20 Jun 2012 10:18:18 -0400 Subject: [MINC-users] Building minc-2.1.12 In-Reply-To: References: Message-ID: Hi Andrew, I used autogen.sh to generate a configure script, but the build still fails in lex.l for minccalc. lex.l:4:18: error: gram.h: No such file or directory Thanks, Andrew On Tue, Jun 19, 2012 at 6:49 PM, Andrew Janke wrote: > Hi Andrew, > >> I downloaded minc-2.1.12.tar.gz from github.com/BIC-MNI/minc/downloads >> and I'm trying to build it. It didn't come with a configure script, so >> I'm wondering if this might not be an actual release. I generated a >> configure script with autotools, but the next failure was missing >> "gram.h" in minccalc. Is there somewhere else I should be looking for >> the latest release? > > If you are building from github as opposd from a release from > packages.bic.mni.mcigill.ca you will first need to run: > > ? $ ./autogen.sh > > In the base MINC directory. This will generate you a configure script > that you can then run. You can also bild MINC with Cmake if you are > that way inclined. > > a > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From assemlal at cim.mcgill.ca Wed Jun 20 10:31:02 2012 From: assemlal at cim.mcgill.ca (Haz-Edine Assemlal) Date: Wed, 20 Jun 2012 10:31:02 -0400 Subject: [MINC-users] Building minc-2.1.12 In-Reply-To: References: Message-ID: <1340202662.3318.16.camel@talos> Hi, Try with CMake: 1 - go to the root directory of minc 2 - mkdir build && cd build 3 - cmake .. ( or ccmake for a gui) 4 - make && make install - Haz-Edine On Wed, 2012-06-20 at 10:18 -0400, Andrew Wood wrote: > Hi Andrew, > > I used autogen.sh to generate a configure script, but the build still > fails in lex.l for minccalc. > > lex.l:4:18: error: gram.h: No such file or directory > > Thanks, > Andrew > > On Tue, Jun 19, 2012 at 6:49 PM, Andrew Janke wrote: > > Hi Andrew, > > > >> I downloaded minc-2.1.12.tar.gz from github.com/BIC-MNI/minc/downloads > >> and I'm trying to build it. It didn't come with a configure script, so > >> I'm wondering if this might not be an actual release. I generated a > >> configure script with autotools, but the next failure was missing > >> "gram.h" in minccalc. Is there somewhere else I should be looking for > >> the latest release? > > > > If you are building from github as opposd from a release from > > packages.bic.mni.mcigill.ca you will first need to run: > > > > $ ./autogen.sh > > > > In the base MINC directory. This will generate you a configure script > > that you can then run. You can also bild MINC with Cmake if you are > > that way inclined. > > > > a > > _______________________________________________ > > MINC-users at bic.mni.mcgill.ca > > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From andrew at biospective.com Wed Jun 20 13:43:54 2012 From: andrew at biospective.com (Andrew Wood) Date: Wed, 20 Jun 2012 13:43:54 -0400 Subject: [MINC-users] Building minc-2.1.12 In-Reply-To: <1340202662.3318.16.camel@talos> References: <1340202662.3318.16.camel@talos> Message-ID: Hi, The cmake build was successful. It would be nice to sort out why the GNU make isn't working, but I can proceed with cmake for now. If one wants to stay up to date with minc releases, which is the best location to watch? Is there a difference between versions suitable for packages.bic.mni.mcigill.ca versus the downloads page at github? Thanks, Andrew On Wed, Jun 20, 2012 at 10:31 AM, Haz-Edine Assemlal wrote: > Hi, > > Try with CMake: > > 1 - go to the root directory of minc > 2 - mkdir build && cd build > 3 - cmake .. ( or ccmake for a gui) > 4 - make && make install > > - > Haz-Edine > > > On Wed, 2012-06-20 at 10:18 -0400, Andrew Wood wrote: >> Hi Andrew, >> >> I used autogen.sh to generate a configure script, but the build still >> fails in lex.l for minccalc. >> >> lex.l:4:18: error: gram.h: No such file or directory >> >> Thanks, >> Andrew >> >> On Tue, Jun 19, 2012 at 6:49 PM, Andrew Janke wrote: >> > Hi Andrew, >> > >> >> I downloaded minc-2.1.12.tar.gz from github.com/BIC-MNI/minc/downloads >> >> and I'm trying to build it. It didn't come with a configure script, so >> >> I'm wondering if this might not be an actual release. I generated a >> >> configure script with autotools, but the next failure was missing >> >> "gram.h" in minccalc. Is there somewhere else I should be looking for >> >> the latest release? >> > >> > If you are building from github as opposd from a release from >> > packages.bic.mni.mcigill.ca you will first need to run: >> > >> > ? $ ./autogen.sh >> > >> > In the base MINC directory. This will generate you a configure script >> > that you can then run. You can also bild MINC with Cmake if you are >> > that way inclined. >> > >> > a >> > _______________________________________________ >> > MINC-users at bic.mni.mcgill.ca >> > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >> _______________________________________________ >> MINC-users at bic.mni.mcgill.ca >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From ayman.oweida at mail.mcgill.ca Wed Jun 20 13:59:34 2012 From: ayman.oweida at mail.mcgill.ca (Ayman Oweida) Date: Wed, 20 Jun 2012 17:59:34 +0000 Subject: [MINC-users] installing mni_autoreg Message-ID: <790582915299864F9DC262BDDC538DF5162069@EXMBX2010-2.campus.MCGILL.CA> I installed mni_autoreg on osx 10.6.8 and I received the error below when running related commands (mritoself, etc). Any insight? Thanks, Ayman Can't locate MNI/Startup.pm in @INC (@INC contains: /sw/lib/perl5/5.10.0/darwin-thread-multi-2level /sw/lib/perl5/5.10.0 /sw/lib/perl5/darwin-thread-multi-2level /sw/lib/perl5 /sw/lib/perl5/darwin /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at /usr/local//bic/bin/mritoself line 31. BEGIN failed--compilation aborted at /usr/local//bic/bin/mritoself line 31. From jason at phenogenomics.ca Wed Jun 20 14:03:39 2012 From: jason at phenogenomics.ca (Jason Lerch) Date: Wed, 20 Jun 2012 14:03:39 -0400 Subject: [MINC-users] installing mni_autoreg In-Reply-To: <790582915299864F9DC262BDDC538DF5162069@EXMBX2010-2.campus.MCGILL.CA> References: <790582915299864F9DC262BDDC538DF5162069@EXMBX2010-2.campus.MCGILL.CA> Message-ID: Install mni_perllib first. mni_perllib-0.08.tar.gz Jason On 2012-06-20, at 1:59 PM, Ayman Oweida wrote: > > I installed mni_autoreg on osx 10.6.8 and I received the error below when running related commands (mritoself, etc). > Any insight? > > Thanks, > Ayman > > > Can't locate MNI/Startup.pm in @INC (@INC contains: /sw/lib/perl5/5.10.0/darwin-thread-multi-2level /sw/lib/perl5/5.10.0 /sw/lib/perl5/darwin-thread-multi-2level /sw/lib/perl5 /sw/lib/perl5/darwin /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at /usr/local//bic/bin/mritoself line 31. > BEGIN failed--compilation aborted at /usr/local//bic/bin/mritoself line 31. > > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From jason at phenogenomics.ca Wed Jun 20 14:07:53 2012 From: jason at phenogenomics.ca (Jason Lerch) Date: Wed, 20 Jun 2012 14:07:53 -0400 Subject: [MINC-users] installing mni_autoreg In-Reply-To: References: <790582915299864F9DC262BDDC538DF5162069@EXMBX2010-2.campus.MCGILL.CA> Message-ID: <36FAE925-5BFD-48B6-8173-636FE5A71124@phenogenomics.ca> Sorry, the link should have been: http://packages.bic.mni.mcgill.ca/tgz/mni_perllib-0.08.tar.gz Jason On 2012-06-20, at 2:03 PM, Jason Lerch wrote: > Install mni_perllib first. > > mni_perllib-0.08.tar.gz > > Jason > > On 2012-06-20, at 1:59 PM, Ayman Oweida wrote: > >> >> I installed mni_autoreg on osx 10.6.8 and I received the error below when running related commands (mritoself, etc). >> Any insight? >> >> Thanks, >> Ayman >> >> >> Can't locate MNI/Startup.pm in @INC (@INC contains: /sw/lib/perl5/5.10.0/darwin-thread-multi-2level /sw/lib/perl5/5.10.0 /sw/lib/perl5/darwin-thread-multi-2level /sw/lib/perl5 /sw/lib/perl5/darwin /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at /usr/local//bic/bin/mritoself line 31. >> BEGIN failed--compilation aborted at /usr/local//bic/bin/mritoself line 31. >> >> >> _______________________________________________ >> MINC-users at bic.mni.mcgill.ca >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From ayman.oweida at mail.mcgill.ca Wed Jun 20 17:45:54 2012 From: ayman.oweida at mail.mcgill.ca (Ayman Oweida) Date: Wed, 20 Jun 2012 21:45:54 +0000 Subject: [MINC-users] installing mni_autoreg In-Reply-To: <36FAE925-5BFD-48B6-8173-636FE5A71124@phenogenomics.ca> References: <36FAE925-5BFD-48B6-8173-636FE5A71124@phenogenomics.ca> Message-ID: <790582915299864F9DC262BDDC538DF51626E4@EXMBX2010-2.campus.MCGILL.CA> Thanks Jason. I followed the instructions for building mni_perl in the readme file, but didn't succeed. I get the following error upon executing perl Makefile.pl Makefile.PL: I don't grok the manifypods section, so can't tweak the pod2man args at Makefile.PL line 162. Writing Makefile for mni_perllib On 2012-06-20, at 2:07 PM, Jason Lerch wrote: > Sorry, the link should have been: > > http://packages.bic.mni.mcgill.ca/tgz/mni_perllib-0.08.tar.gz > > Jason > > On 2012-06-20, at 2:03 PM, Jason Lerch wrote: > >> Install mni_perllib first. >> >> mni_perllib-0.08.tar.gz >> >> Jason >> >> On 2012-06-20, at 1:59 PM, Ayman Oweida wrote: >> >>> >>> I installed mni_autoreg on osx 10.6.8 and I received the error below when running related commands (mritoself, etc). >>> Any insight? >>> >>> Thanks, >>> Ayman >>> >>> >>> Can't locate MNI/Startup.pm in @INC (@INC contains: /sw/lib/perl5/5.10.0/darwin-thread-multi-2level /sw/lib/perl5/5.10.0 /sw/lib/perl5/darwin-thread-multi-2level /sw/lib/perl5 /sw/lib/perl5/darwin /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at /usr/local//bic/bin/mritoself line 31. >>> BEGIN failed--compilation aborted at /usr/local//bic/bin/mritoself line 31. >>> >>> >>> _______________________________________________ >>> MINC-users at bic.mni.mcgill.ca >>> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >> >> _______________________________________________ >> MINC-users at bic.mni.mcgill.ca >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users Ayman Oweida, MSc PhD Candidate McGill University Department of Experimental Medicine Montreal General Hospital 1650 Cedar Ave, L5-112 Montreal, QC H3G 1A4 (514) 934-1934 x. 43019 From a.janke at gmail.com Wed Jun 20 23:44:18 2012 From: a.janke at gmail.com (Andrew Janke) Date: Thu, 21 Jun 2012 13:44:18 +1000 Subject: [MINC-users] Building minc-2.1.12 In-Reply-To: References: <1340202662.3318.16.camel@talos> Message-ID: Hi Andrew, On 21 June 2012 03:43, Andrew Wood wrote: > The cmake build was successful. It would be nice to sort out why the > GNU make isn't working, but I can proceed with cmake for now. Do you have bison and yacc installed? The CMake build builds from a static generated .c file in minccalc instead of from the original .l and .y files. > If one wants to stay up to date with minc releases, which is the best > location to watch? Is there a difference between versions suitable for > packages.bic.mni.mcigill.ca versus the downloads page at github? packages.bic.mni.mcigill.ca contains official releases, the github pages is for development work. a From zijdenbos at gmail.com Wed Jun 20 23:53:42 2012 From: zijdenbos at gmail.com (Alex Zijdenbos) Date: Wed, 20 Jun 2012 23:53:42 -0400 Subject: [MINC-users] mincblur with FWHM =?utf-8?Q?<=3D_?=voxel dims Message-ID: <0A683A0DC4174CFDBCB6651E4B3DF5E3@gmail.com> I've been wondering for some time what happens when you (minc)blur a volume with a FWHM that is about the same or less than the voxel dimension. Admittedly I am rather rusty on the intricate and practical details of scale space/FFT/convolution/etc, so this may well be showing my ignorance; but hopefully there are people on this list smarter than me who can enlighten me :) Empirically, when you reduce the FWHM to below the voxel dimension, the voxel value of the blurred image increases. Moreover, for an image with 1mm isotropic voxels, the FWHM at which the voxel values of the result are about equivalent to those in the source image seems to be around 1.3, give or take. See this image: ? mni_icbm_00102_t1_blurs.png (http://cl.ly/2A1m3Y470P0M3S3J2Q0j) which shows in the top row the original, 1mm isotropic, volume, followed by the result of running mincblur on it with decreasing FWHM from 1.5 to 0.5mm. I used spectral with a fixed range across all rows to bring out the signal difference. So - is this expected? Surprising? Follows theory or bad behaviour of mincblur? After scribbling a few pages with normal distributions and looking through the mincblur code I still can't quite figure it out. Anybody can explain this to me? Thanks, -- Alex PS In case you are wondering why one would want to do this, the answer is probably: you don't; but one of the nice things about MINC is that as a user I don't need to care too much about pesky things like voxel dimensions, so let's say you have a script that blurs with a 2mm FWHM and you happen to pass that an image with 4mm voxels, you will end up with a more than 6-fold signal increase that you probably didn't expect (e.g., run a PET image through an MRI registration script). I could also imagine that in certain circumstances it might bite other blurring-dependent analyses (e.g., fMRI, VBM). From a.janke at gmail.com Thu Jun 21 02:34:57 2012 From: a.janke at gmail.com (Andrew Janke) Date: Thu, 21 Jun 2012 16:34:57 +1000 Subject: [MINC-users] mincblur with FWHM <= voxel dims In-Reply-To: <0A683A0DC4174CFDBCB6651E4B3DF5E3@gmail.com> References: <0A683A0DC4174CFDBCB6651E4B3DF5E3@gmail.com> Message-ID: On 21 June 2012 13:53, Alex Zijdenbos wrote: > Empirically, when you reduce the FWHM to below the voxel dimension, the voxel value of the blurred image increases. Moreover, for an image with 1mm isotropic voxels, the FWHM at which the voxel values of the result are about equivalent to those in the source image seems to be around 1.3, give or take. See this image: > > mni_icbm_00102_t1_blurs.png (http://cl.ly/2A1m3Y470P0M3S3J2Q0j) > > which shows in the top row the original, 1mm isotropic, volume, followed by the result of running mincblur on it with decreasing FWHM from 1.5 to 0.5mm. I used spectral with a fixed range across all rows to bring out the signal difference. > > So - is this expected? Surprising? Follows theory or bad behaviour of mincblur? After scribbling a few pages with normal distributions and looking through the mincblur code I still can't quite figure it out. Anybody can explain this to me? I'd say expected (given how mincblur works) and I'd also say is the correct behaviour. If you think of the blur as fitting a Gaussian to your noisy peak then as the width of this peak decreases, the height of it increases to the same given amount of signal. As for if it should happen when you (or a script) doesn't sanitise inputs then you probably have an argument that mincblur should give a warning. I would argue that the script should check the input sampling though, certainly I remember doing this in a few scripts of mine. I won't be so bold to say that I do check in all scripts I write though! a From a.janke at gmail.com Thu Jun 21 02:36:45 2012 From: a.janke at gmail.com (Andrew Janke) Date: Thu, 21 Jun 2012 16:36:45 +1000 Subject: [MINC-users] installing mni_autoreg In-Reply-To: <790582915299864F9DC262BDDC538DF51626E4@EXMBX2010-2.campus.MCGILL.CA> References: <36FAE925-5BFD-48B6-8173-636FE5A71124@phenogenomics.ca> <790582915299864F9DC262BDDC538DF51626E4@EXMBX2010-2.campus.MCGILL.CA> Message-ID: > I followed the instructions for building mni_perl in the readme file, but didn't succeed. > I get the following error upon executing perl Makefile.pl > > Makefile.PL: I don't grok the manifypods section, so can't tweak the pod2man args at Makefile.PL line 162. > Writing Makefile for mni_perllib This should only be a warning. The general process for perl modules is this: $ tar zxvf perllib.tgz $ cd perllib $ perl Makefile.PL $ make $ make check # optional $ sudo make install a From a.janke at gmail.com Thu Jun 21 08:15:11 2012 From: a.janke at gmail.com (Andrew Janke) Date: Thu, 21 Jun 2012 22:15:11 +1000 Subject: [MINC-users] HDF5-1.8.5 vs HDF5-1.8.5-patch1 In-Reply-To: References: Message-ID: Hi Andrew, > I ran into a problem running minc commands on gzipped files (I'm using a > locally-built MINC 2.1 and HDF5-1.8.5-patch1): > > $ mincinfo icbm_avg_152_t1_tal_nlin_symmetric_VI_mask.mnc.gz > ?(from miexpand_file): Cannot uncompress the file > mincinfo: Error expanding file > "icbm_avg_152_t1_tal_nlin_symmetric_VI_mask.mnc.gz" Thanks for this report. At the time I remember building against this specific release and hitting the same problem. I haven't found the cause of the problem but I have yet to see it rear it's head again with later builds up to 1.8.9 (the current release). Here's hoping we can tick this one off as "done". Thanks a From ayman.oweida at mail.mcgill.ca Fri Jun 22 10:39:01 2012 From: ayman.oweida at mail.mcgill.ca (Ayman Oweida) Date: Fri, 22 Jun 2012 14:39:01 +0000 Subject: [MINC-users] installing mni_autoreg In-Reply-To: References: <36FAE925-5BFD-48B6-8173-636FE5A71124@phenogenomics.ca> <790582915299864F9DC262BDDC538DF51626E4@EXMBX2010-2.campus.MCGILL.CA> Message-ID: <790582915299864F9DC262BDDC538DF51699B5@EXMBX2010-1.campus.MCGILL.CA> So, after running the commands below, I get the following: Ayman-Oweidas-MacBook-Pro:mni_perllib-0.08 Ayman$ sudo make install Password: Manifying blib/man3/MNI::DataDir.3pm Not a HASH reference at /System/Library/Perl/5.10.0/ExtUtils/Install.pm line 557. make: *** [pure_site_install] Error 2 Your help is appreciated. -Ayman On 2012-06-21, at 2:36 AM, Andrew Janke wrote: >> I followed the instructions for building mni_perl in the readme file, but didn't succeed. >> I get the following error upon executing perl Makefile.pl >> >> Makefile.PL: I don't grok the manifypods section, so can't tweak the pod2man args at Makefile.PL line 162. >> Writing Makefile for mni_perllib > > This should only be a warning. The general process for perl modules is this: > > $ tar zxvf perllib.tgz > > $ cd perllib > > $ perl Makefile.PL > > $ make > > $ make check # optional > > $ sudo make install > > > a > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From jon.pipitone at utoronto.ca Fri Jun 22 11:27:55 2012 From: jon.pipitone at utoronto.ca (jon pipitone) Date: Fri, 22 Jun 2012 11:27:55 -0400 Subject: [MINC-users] mincresample MINC 2.0 compression Message-ID: Hey all, I'm currently doing some processing work in which I need to take care of the storage space I'm consuming, so I'd like to keep my minc volumes compressed where possible. I see that mincconvert has the option to compress a volume in 2.0 format, but is there any way to *produce* a compressed volume as the output of mincresample and friends? The help for mincresample (2.1.01) shows nothing obvious to do this, but maybe I'm overlooking something as I'm pretty new to these tools. Of course, I can always just run a pass of mincconvert to compress my outputs as I go, but it would be handy to be able to do this in a single step. Thanks, Jon. From jason at phenogenomics.ca Fri Jun 22 11:39:09 2012 From: jason at phenogenomics.ca (Jason Lerch) Date: Fri, 22 Jun 2012 11:39:09 -0400 Subject: [MINC-users] mincresample MINC 2.0 compression In-Reply-To: References: Message-ID: Set the MINC_COMPRESS environment variable (4 is a good setting) to force compression of all MINC2 volumes. Jason On 2012-06-22, at 11:27 AM, jon pipitone wrote: > Hey all, > > I'm currently doing some processing work in which I need to take care of > the storage space I'm consuming, so I'd like to keep my minc volumes > compressed where possible. I see that mincconvert has the option to > compress a volume in 2.0 format, but is there any way to *produce* a > compressed volume as the output of mincresample and friends? The help for > mincresample (2.1.01) shows nothing obvious to do this, but maybe I'm > overlooking something as I'm pretty new to these tools. > > Of course, I can always just run a pass of mincconvert to compress my > outputs as I go, but it would be handy to be able to do this in a single > step. > > Thanks, > Jon. > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From jon.pipitone at utoronto.ca Fri Jun 22 11:53:07 2012 From: jon.pipitone at utoronto.ca (jon pipitone) Date: Fri, 22 Jun 2012 11:53:07 -0400 Subject: [MINC-users] mincresample MINC 2.0 compression In-Reply-To: References: Message-ID: > > Set the MINC_COMPRESS environment variable (4 is a good setting) to force > compression of all MINC2 volumes. > Magic! Thanks Jason, Jon. From a.janke at gmail.com Sun Jun 24 06:52:36 2012 From: a.janke at gmail.com (Andrew Janke) Date: Sun, 24 Jun 2012 20:52:36 +1000 Subject: [MINC-users] installing mni_autoreg In-Reply-To: <790582915299864F9DC262BDDC538DF51699B5@EXMBX2010-1.campus.MCGILL.CA> References: <36FAE925-5BFD-48B6-8173-636FE5A71124@phenogenomics.ca> <790582915299864F9DC262BDDC538DF51626E4@EXMBX2010-2.campus.MCGILL.CA> <790582915299864F9DC262BDDC538DF51699B5@EXMBX2010-1.campus.MCGILL.CA> Message-ID: > So, after running the commands below, I get the following: > > Ayman-Oweidas-MacBook-Pro:mni_perllib-0.08 Ayman$ sudo make install > Password: > Manifying blib/man3/MNI::DataDir.3pm > Not a HASH reference at /System/Library/Perl/5.10.0/ExtUtils/Install.pm line 557. > make: *** [pure_site_install] Error 2 I am guessing that by this stage everything up until this has completed OK? I am guessing you are using the inbuilt perl in OSX? On older versions of OSX I found this problematic and used the macports or fink version but am not sure if this is still the case. There are others on here who use OSX and MINC so I am hoping they will chime in here. a From zijdenbos at gmail.com Sun Jun 24 17:20:54 2012 From: zijdenbos at gmail.com (Alex Zijdenbos) Date: Sun, 24 Jun 2012 23:20:54 +0200 Subject: [MINC-users] mincblur with FWHM =?utf-8?Q?<=3D_?=voxel dims In-Reply-To: References: <0A683A0DC4174CFDBCB6651E4B3DF5E3@gmail.com> Message-ID: On Thursday, 21 June, 2012 at 8:34 AM, Andrew Janke wrote: > On 21 June 2012 13:53, Alex Zijdenbos wrote: > > Empirically, when you reduce the FWHM to below the voxel dimension, the voxel value of the blurred image increases. Moreover, for an image with 1mm isotropic voxels, the FWHM at which the voxel values of the result are about equivalent to those in the source image seems to be around 1.3, give or take. See this image: > > > > mni_icbm_00102_t1_blurs.png (http://cl.ly/2A1m3Y470P0M3S3J2Q0j) > > > > which shows in the top row the original, 1mm isotropic, volume, followed by the result of running mincblur on it with decreasing FWHM from 1.5 to 0.5mm. I used spectral with a fixed range across all rows to bring out the signal difference. > > > > So - is this expected? Surprising? Follows theory or bad behaviour of mincblur? After scribbling a few pages with normal distributions and looking through the mincblur code I still can't quite figure it out. Anybody can explain this to me? > > I'd say expected (given how mincblur works) and I'd also say is the > correct behaviour. If you think of the blur as fitting a Gaussian to > your noisy peak then as the width of this peak decreases, the height > of it increases to the same given amount of signal. > > That is also the explanation I managed to come up with; however, having studied this a bit further, I disagree with this being the "correct" behaviour. (Gaussian) blurring is expected to adhere to "average grey level invariance", meaning that the filter should not modify the mean value of the image. And that is not a resolution-dependent principle, so I would say that mincblur should adhere to this regardless of the relationship between the kernel width and voxel size. I did some experimenting by blurring a binary cube in an image and monitoring the mean value (generously padded and away from the image edge to avoid edge effects). See this graph: ?mincblur_mean.png (http://cl.ly/2V472I092L3U3R3e0k02) which shows the mean value of the 1mm isotropic image as a function of kernel FWHM running from 0.2 to 5.0mm with 0.1mm steps. You can see that for FWHM < 2*voxel_dim the mean signal starts to go up rather steeply. By contrast, the orange HR line is from the same image, but obtained by first upsampling it to a relatively high (0.1mm) resolution, performing the blur at that resolution, and downsampling the result. I would argue that, barring some resampling effects, these curves should be the same. I should note that the blurring implemented in FSL for example, does adhere to the average grey level invariance principle (regardless of voxel size). > As for if it should happen when you (or a script) doesn't sanitize > inputs then you probably have an argument that mincblur should give a > warning. I would argue that the script should check the input sampling > though, certainly I remember doing this in a few scripts of mine. I > won't be so bold to say that I do check in all scripts I write though! > > :) neither would I. But I actually think that mincblur should be fixed, in which case it won't need to produce a warning. I would imagine this means changing the kernel normalization. Of course a wrapper script could also fix this simply by scaling the image; but figuring out the right scaling factor would probably involve padding the images prior to blurring to not be affected by edge effects. -- A From vladimir.fonov at gmail.com Sun Jun 24 20:07:22 2012 From: vladimir.fonov at gmail.com (Vladimir S. Fonov) Date: Sun, 24 Jun 2012 20:07:22 -0400 Subject: [MINC-users] mincblur with FWHM <= voxel dims In-Reply-To: References: <0A683A0DC4174CFDBCB6651E4B3DF5E3@gmail.com> Message-ID: <4FE7ABBA.3060802@gmail.com> Hello, I have my own implementation of gaussian blurring in EZminc: https://github.com/vfonov/EZminc/blob/master/tools/fast_blur.cpp (fast_blur binary in the minc-toolkit) . I think it behaves properly for any blurring kernel size, and it produces the same results as mincblur when fwhm> 2*voxel size On 24/06/2012 5:20 PM, Alex Zijdenbos wrote: > I did some experimenting by blurring a binary cube in an image and > monitoring the mean value (generously padded and away from the image > edge to avoid edge effects). See this graph: ?mincblur_mean.png > (http://cl.ly/2V472I092L3U3R3e0k02) which shows the mean value of the > 1mm isotropic image as a function of kernel FWHM running from 0.2 to > 5.0mm with 0.1mm steps. You can see that for FWHM< 2*voxel_dim the > mean signal starts to go up rather steeply. By contrast, the orange > HR line is from the same image, but obtained by first upsampling it > to a relatively high (0.1mm) resolution, performing the blur at that > resolution, and downsampling the result. I would argue that, barring > some resampling effects, these curves should be the same. -- Best regards, Vladimir S. Fonov ~ vladimir fonov gmail com From zijdenbos at gmail.com Mon Jun 25 17:44:51 2012 From: zijdenbos at gmail.com (Alex Zijdenbos) Date: Mon, 25 Jun 2012 23:44:51 +0200 Subject: [MINC-users] mincblur with FWHM =?utf-8?Q?<=3D_?=voxel dims In-Reply-To: <4FE7ABBA.3060802@gmail.com> References: <0A683A0DC4174CFDBCB6651E4B3DF5E3@gmail.com> <4FE7ABBA.3060802@gmail.com> Message-ID: <1DDC786AF7C54760BB45F75C40D0426A@gmail.com> Thanks, Vladimir - this is very interesting. Tried, tested, and true - I ran the same series of blurring experiments, and comparing mincblur to fast_blur you are absolutely correct that it maintains grey level across all kernel widths, see this snap: ? mincblur-fastblur_4.00mm.png (http://cl.ly/3o3f0l1o0J330s3X3M42) The image comparison on the right is the mincblur result of the 5mm blurring kernel (left column) and the difference (simple subtraction) between the mincblur and fast_blur result at that scale. Some things of note: - fast_blur maintains average grey level to at least 6 decimals; you can see in the graph above that mincblur deviates somewhat even all the way out to 5x voxel size - mincblur also generates some odd artifacts (the dot pattern) that I haven't been able to explain so far. - as the 'picture frame' image on the right shows, there are some slight differences between both methods. The amplitude of that diff is very small though, in the range [-2e-5,2e-5] so that is probably just quantization (the in-/and output volumes are short). - fast_blur uses about 40% more memory. With the exception of that last point, I think fast_blur wins this contest hands down? Question perhaps is: should we "MINC" have multiple pieces of code for doing the exact same thing, slightly differently? Me thinks not, but? -- A -- Alex Zijdenbos Sent with Sparrow (http://www.sparrowmailapp.com) On Monday, 25 June, 2012 at 2:07 AM, Vladimir S. Fonov wrote: > Hello, > > I have my own implementation of gaussian blurring in EZminc: > https://github.com/vfonov/EZminc/blob/master/tools/fast_blur.cpp > (fast_blur binary in the minc-toolkit) . > I think it behaves properly for any blurring kernel size, and it > produces the same results as mincblur when fwhm> 2*voxel size > > On 24/06/2012 5:20 PM, Alex Zijdenbos wrote: > > I did some experimenting by blurring a binary cube in an image and > > monitoring the mean value (generously padded and away from the image > > edge to avoid edge effects). See this graph: ?mincblur_mean.png > > (http://cl.ly/2V472I092L3U3R3e0k02) which shows the mean value of the > > 1mm isotropic image as a function of kernel FWHM running from 0.2 to > > 5.0mm with 0.1mm steps. You can see that for FWHM< 2*voxel_dim the > > mean signal starts to go up rather steeply. By contrast, the orange > > HR line is from the same image, but obtained by first upsampling it > > to a relatively high (0.1mm) resolution, performing the blur at that > > resolution, and downsampling the result. I would argue that, barring > > some resampling effects, these curves should be the same. > > > > > -- > Best regards, > > Vladimir S. Fonov ~ vladimir fonov gmail com > _______________________________________________ > MINC-users at bic.mni.mcgill.ca (mailto:MINC-users at bic.mni.mcgill.ca) > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > From vladimir.fonov at gmail.com Mon Jun 25 20:24:45 2012 From: vladimir.fonov at gmail.com (Vladimir S. Fonov) Date: Mon, 25 Jun 2012 20:24:45 -0400 Subject: [MINC-users] mincblur with FWHM <= voxel dims In-Reply-To: <1DDC786AF7C54760BB45F75C40D0426A@gmail.com> References: <0A683A0DC4174CFDBCB6651E4B3DF5E3@gmail.com> <4FE7ABBA.3060802@gmail.com> <1DDC786AF7C54760BB45F75C40D0426A@gmail.com> Message-ID: <4FE9014D.602@gmail.com> Hello, fast_blur uses FFTW library to perform it's calculations, which is distributed under GPL license. So, effectively EZminc should also be distributed under GPL license. On the other hand mincblur is part of mni_autoreg with it's own implementation of FFT (?) and also distributed under it's own license ( see https://github.com/BIC-MNI/mni_autoreg/blob/master/COPYING ). On 12-06-25 05:44 PM, Alex Zijdenbos wrote: > With the exception of that last point, I think fast_blur wins this > contest hands down? > > Question perhaps is: should we "MINC" have multiple pieces of code > for doing the exact same thing, slightly differently? Me thinks not, > but? -- Best regards, Vladimir S. Fonov ~ vladimir.fonov gmail.com From a.janke at gmail.com Mon Jun 25 21:21:15 2012 From: a.janke at gmail.com (Andrew Janke) Date: Tue, 26 Jun 2012 11:21:15 +1000 Subject: [MINC-users] mincblur with FWHM <= voxel dims In-Reply-To: <4FE9014D.602@gmail.com> References: <0A683A0DC4174CFDBCB6651E4B3DF5E3@gmail.com> <4FE7ABBA.3060802@gmail.com> <1DDC786AF7C54760BB45F75C40D0426A@gmail.com> <4FE9014D.602@gmail.com> Message-ID: On 26 June 2012 10:24, Vladimir S. Fonov wrote: > On the other hand mincblur is part of mni_autoreg with it's own > implementation of FFT My understanding is that louis based his fft upon the NR in C version. mincblur has also long been on my list of things to re-implement with support for arbitrary bluring in multiple dimensions (>4) but haven't got to it. There is also mincfft that uses fftw but it is a separate package for this same licensing issue. a From zijdenbos at gmail.com Wed Jun 27 11:15:13 2012 From: zijdenbos at gmail.com (Alex Zijdenbos) Date: Wed, 27 Jun 2012 17:15:13 +0200 Subject: [MINC-users] mincblur with FWHM =?utf-8?Q?<=3D_?=voxel dims In-Reply-To: References: <0A683A0DC4174CFDBCB6651E4B3DF5E3@gmail.com> <4FE7ABBA.3060802@gmail.com> <1DDC786AF7C54760BB45F75C40D0426A@gmail.com> <4FE9014D.602@gmail.com> Message-ID: <0A07FDDA9EF248D2A11CC2FEECD43192@gmail.com> Hrm those pesky licensing issues :-} Not that I necessarily want to continue to harp on mincblur (where is Louis anyways?), but I just stumbled across something else with mincblur that has me a bit stumped. I had to dig this one fairly deep out of a registration script which seemed to be behaving oddly. Take a look at this image: ?test_blur.png (http://cl.ly/2E362x310I231C1T1W3u) These are two virtually identical images with the standard 1mm stx sampling (top two rows); the third row is the difference between them (simple subtraction); and the 4th and 5th rows are the result of mincblurring each of them with an 8mm FWHM kernel. For some reason, the blurred result of (only) one of the two produces a strong edge artifact. Adding the -no_apodize option removed the edge effect; but that doesn't seem to explain why two almost-identical images would result in such different blurring behaviour. -- A On Tuesday, 26 June, 2012 at 3:21 AM, Andrew Janke wrote: > On 26 June 2012 10:24, Vladimir S. Fonov wrote: > > On the other hand mincblur is part of mni_autoreg with it's own > > implementation of FFT > > > > > My understanding is that louis based his fft upon the NR in C version. > mincblur has also long been on my list of things to re-implement with > support for arbitrary bluring in multiple dimensions (>4) but haven't > got to it. > > There is also mincfft that uses fftw but it is a separate package for > this same licensing issue. > > a > _______________________________________________ > MINC-users at bic.mni.mcgill.ca (mailto:MINC-users at bic.mni.mcgill.ca) > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > From a.janke at gmail.com Wed Jun 27 21:15:07 2012 From: a.janke at gmail.com (Andrew Janke) Date: Thu, 28 Jun 2012 11:15:07 +1000 Subject: [MINC-users] mincblur with FWHM <= voxel dims In-Reply-To: <0A07FDDA9EF248D2A11CC2FEECD43192@gmail.com> References: <0A683A0DC4174CFDBCB6651E4B3DF5E3@gmail.com> <4FE7ABBA.3060802@gmail.com> <1DDC786AF7C54760BB45F75C40D0426A@gmail.com> <4FE9014D.602@gmail.com> <0A07FDDA9EF248D2A11CC2FEECD43192@gmail.com> Message-ID: You'll find that this is because the second image (69) has been cropped aggressively. If your image "touches" the edge then the way that mincblur works will cause this effect. I tend to autopad all input images to such registration pipes for this (And other) reasons. a On 28 June 2012 01:15, Alex Zijdenbos wrote: > These are two virtually identical images with the standard 1mm stx sampling (top two rows); the third row is the difference between them (simple subtraction); and the 4th and 5th rows are the result of mincblurring each of them with an 8mm FWHM kernel. For some reason, the blurred result of (only) one of the two produces a strong edge artifact. From zijdenbos at gmail.com Fri Jun 29 06:15:54 2012 From: zijdenbos at gmail.com (Alex Zijdenbos) Date: Fri, 29 Jun 2012 12:15:54 +0200 Subject: [MINC-users] mincblur with FWHM <= voxel dims In-Reply-To: References: <0A683A0DC4174CFDBCB6651E4B3DF5E3@gmail.com> <4FE7ABBA.3060802@gmail.com> <1DDC786AF7C54760BB45F75C40D0426A@gmail.com> <4FE9014D.602@gmail.com> <0A07FDDA9EF248D2A11CC2FEECD43192@gmail.com> Message-ID: True that padding 1 voxel all around also makes the problem go away; however the egge "touchiness" of these two is really quite similar so it's still not clear to me what sets this off. But then I do also tend to pad images in registration pipes but not always; and I hadn't actually seen this behaviour before. Good to know :) Thanks, -- A On Thu, Jun 28, 2012 at 3:15 AM, Andrew Janke wrote: > You'll find that this is because the second image (69) has been > cropped aggressively. If your image "touches" the edge then the way > that mincblur works will cause this effect. > > I tend to autopad all input images to such registration pipes for this > (And other) reasons. > > > a > > On 28 June 2012 01:15, Alex Zijdenbos wrote: >> These are two virtually identical images with the standard 1mm stx sampling (top two rows); the third row is the difference between them (simple subtraction); and the 4th and 5th rows are the result of mincblurring each of them with an 8mm FWHM kernel. For some reason, the blurred result of (only) one of the two produces a strong edge artifact. > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >