From mishkind at gmail.com Fri Sep 2 13:43:18 2011 From: mishkind at gmail.com (Mishkin Derakhshan) Date: Fri, 2 Sep 2011 13:43:18 -0400 Subject: [MINC-users] brain-view In-Reply-To: References: Message-ID: Thank you all for the suggestions. 1. Andrew, you're binary in /beta/ did not work at first. Could not find libvolume_io.so.1. The reason is that my minc build is all static so I only had .a files. A little google magic later and i created the shared object. I had to do the same for libminc2.so.1, but so far it is working, so ugly hacks aside, problem solved. ar -x libvolume_io2.a gcc -shared *.o -o libvolume_io2.so.1 sudo cp libvolume_io2.so.1 /usr/lib/ 2. For fun (haha) I tried compiling brain-view2 from source, but ran into this error: qmake-qt4 MINCDIR=/opt/minc/ QUARTERDIR=/usr/local/include/Quarter/ brain-view2.pro make textureColumn.h:6:30: fatal error: mniVertstatsFile.h: No such file or directory Looks like I'm missing mniVerstatsFile.h, which I think is part of oobic, so i tried to compile that but I can't figure out where to get the arguments library from: ./configure --prefix=/opt/minc --with-build-path=/opt/minc --with-minc2 --with-x --with-static checking for -larguments... configure: error: cannot find arguments library Any idea where the arguments comes from? Andrew, from your magic line I had to change libsoqt3-dev to libsoqt4-dev and i also had no candidate for libmni-perllib-perl, but i managed to just install the .deb from the http://packages.bic.mni.mcgill.ca/ubuntu-maverick/libmni-perllib-perl_0.08-1_all.deb. mishkin On Fri, Aug 26, 2011 at 12:42 AM, Andrew Janke wrote: > On 26 August 2011 03:34, Mishkin Derakhshan wrote: >> >> I need to build it on a 64-bit ubuntu 11.04 system. Is there a list of >> what dependencies are required (what version of Coin/QT etc.). > > Here is the line of magic that I use: > > > $ sudo apt-get install libnetcdf-dev libhdf5-serial-dev libnetpbm9-dev > fftw-dev libgsl0-dev libgetopt-tabular-perl libmni-perllib-perl > libxext-dev glutg3-dev libsoqt3-dev libxmu-dev libxi-dev imagemagick > libtext-format-perl libpcre++0 libpcre3 libsimage-dev libpcre++-dev > > > a > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From lrisa87 at uw.edu Fri Sep 2 18:05:33 2011 From: lrisa87 at uw.edu (Lisa F. Akiyama) Date: Fri, 2 Sep 2011 15:05:33 -0700 Subject: [MINC-users] Compute overlap? In-Reply-To: References: Message-ID: Hi Andrew and Alex, Sorry about my delayed response. Thank you for your assistance. Just for clarification - the mincmath -and option calculates the volumes shared by both input1 and inpu2? Thank you. Best, Lisa On Wed, Aug 31, 2011 at 7:17 AM, Andrew Janke wrote: > >> http://en.wikipedia.org/wiki/Dice%27s_coefficient > > > > Actually, it does not; the difference is that I use -add in the > > mincmath call, so $stats[1] becomes n_intersection, and $stats[0] is > > the sum of the relative complements. In other words, if the regions > > are A and B, you calculate the denominator as > > > > n(A) + n(B) > > > > which is equal to > > > > 2 * n(A ^ B) + n(A\B) + n(B\A) > > Ah, now I am with you.... > > >> Although I am sure there are more things to compare with than just > >> Dice's coefficient. > > > > That too - I'm always fascinated how many ways there are to turn the 4 > > values of a 2x2 confusion matrix into a number :) voldiff calculates > > some but there are many more. > > Aye, I got half way through re-implementing the core of voldiff in > minccmp for integer input volumes a while back but gave up with all > the seemingly multiple contradictory definitions of how things should > be done with a n x n confusion matrix across a variable number of > files! (you'll see a commented out -kappa option in there). > > All this talk of binary comparisons has got me all energised to finish > it off again... > > > a > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From lrisa87 at uw.edu Fri Sep 2 20:02:37 2011 From: lrisa87 at uw.edu (Lisa F. Akiyama) Date: Fri, 2 Sep 2011 17:02:37 -0700 Subject: [MINC-users] Can't properly convert nifti to minc In-Reply-To: References: Message-ID: Hello MINC experts, I am having difficulty converting certain nifti files to minc. The niti files have the float datatype (bitpix 32). Even when I specify -float when running nii2mnc, I get minc images that actually look like short data types (please find the screenshot here- the left image is the minc output I am getting, the right is the original nifti file.) Any tips on solving this problem? Thank you. Best, Lisa From a.janke at gmail.com Sat Sep 3 10:58:42 2011 From: a.janke at gmail.com (Andrew Janke) Date: Sun, 4 Sep 2011 00:58:42 +1000 Subject: [MINC-users] Compute overlap? In-Reply-To: References: Message-ID: Hi Lisa, On 3 September 2011 08:05, Lisa F. Akiyama wrote: > > Just for clarification - the mincmath -and option calculates the volumes > shared by both input1 and inpu2? Correct, It is the intersection of the two. a From a.janke at gmail.com Sat Sep 3 11:00:15 2011 From: a.janke at gmail.com (Andrew Janke) Date: Sun, 4 Sep 2011 01:00:15 +1000 Subject: [MINC-users] brain-view In-Reply-To: References: Message-ID: > 1. Andrew, you're binary in /beta/ did not work at first. Could not > find libvolume_io.so.1. The reason is that my minc build is all static > so I only had .a files. A little google magic later and i created the > shared object. I had to do the same for libminc2.so.1, but so far it > is working, so ugly hacks aside, problem solved. Good good. > Looks like I'm missing mniVerstatsFile.h, which I think is part of > oobic, so i tried to compile that but I can't figure out where to get > the arguments library from: > > ./configure --prefix=/opt/minc --with-build-path=/opt/minc > --with-minc2 --with-x --with-static > checking for -larguments... configure: error: cannot find arguments library > > Any idea where the arguments comes from? It's a BIC thing, find it here: http://packages.bic.mni.mcgill.ca/tgz a From graeme.okeefe at petnm.unimelb.edu.au Fri Sep 9 08:55:21 2011 From: graeme.okeefe at petnm.unimelb.edu.au (Graeme O'Keefe) Date: Fri, 9 Sep 2011 22:55:21 +1000 Subject: [MINC-users] saving a 4d volume with non-uniform time steps Message-ID: Hi Jason, I have a dynamic PET scan in Philips format (UGM) that I wish to convert to minc2. The time-step is not constant. Can you tell me how I would save a "tspace" vector containing the times of each frame using volumeFromDescription? From sva2mnc.py : vol = volumeFromDescription(output_filename, ["yspace","zspace","xspace"], [int(dims[0]), int(dims[1]), int(dims[2])], [55,367,227], [-step,-step,-step]) cheers, Graeme Graeme O'Keefe, PhD,MACPSEM Principal Physicist Centre for PET Austin Hospital Tel: (613)-9496-5767 Mob: 0408-224-054 Fax: (613) 9458-5023 From lrisa87 at uw.edu Mon Sep 12 14:13:46 2011 From: lrisa87 at uw.edu (Lisa F. Akiyama) Date: Mon, 12 Sep 2011 11:13:46 -0700 Subject: [MINC-users] Can't properly convert nifti to minc In-Reply-To: References: Message-ID: Hello MINC experts, I am having difficulty converting certain nifti files to minc. The niti files have the float datatype (bitpix 32). Even when I specify -float when running nii2mnc, I get minc images that actually look like short data types (please find the screenshot here- the left image is the minc output I am getting, the right is the original nifti file.) Any tips on solving this problem? Thank you. Best, Lisa From eskild at gmail.com Mon Sep 12 14:30:11 2011 From: eskild at gmail.com (Simon Eskildsen) Date: Mon, 12 Sep 2011 14:30:11 -0400 Subject: [MINC-users] Can't properly convert nifti to minc In-Reply-To: References: Message-ID: Hi Lisa, What version of minc/hdf5 are you using? nii2mnc -version Do you have an example nifti file we can test? Simon On Mon, Sep 12, 2011 at 2:13 PM, Lisa F. Akiyama wrote: > Hello MINC experts, > > I am having difficulty converting certain nifti files to minc. > The niti files have the float datatype (bitpix 32). > Even when I specify -float when running nii2mnc, I get minc images that > actually look like short data types (please find the screenshot > here< > https://picasaweb.google.com/lh/photo/Rs4F9QpNHQ9MzstLDC_gotB0iJqzGfYoF84zUfqtJpk?feat=directlink > >- > the left image is the minc output I am getting, the right is the > original > nifti file.) > Any tips on solving this problem? > > Thank you. > > > Best, > Lisa > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From lrisa87 at uw.edu Mon Sep 12 16:05:12 2011 From: lrisa87 at uw.edu (Lisa F. Akiyama) Date: Mon, 12 Sep 2011 13:05:12 -0700 Subject: [MINC-users] Can't properly convert nifti to minc In-Reply-To: References: Message-ID: Hi Simon, Here are the versions that I am using: nii2mnc -version program: 2.1.00 libminc: 2.1.00 netcdf : 4.1.1 of May 15 2010 04:10:51 $ HDF5 : 1.8.4 I'll send you a sample nifti file directly to you. Thank you! Best, Lisa On Mon, Sep 12, 2011 at 11:30 AM, Simon Eskildsen wrote: > Hi Lisa, > > What version of minc/hdf5 are you using? > nii2mnc -version > > Do you have an example nifti file we can test? > > Simon > > On Mon, Sep 12, 2011 at 2:13 PM, Lisa F. Akiyama wrote: > > > Hello MINC experts, > > > > I am having difficulty converting certain nifti files to minc. > > The niti files have the float datatype (bitpix 32). > > Even when I specify -float when running nii2mnc, I get minc images that > > actually look like short data types (please find the screenshot > > here< > > > https://picasaweb.google.com/lh/photo/Rs4F9QpNHQ9MzstLDC_gotB0iJqzGfYoF84zUfqtJpk?feat=directlink > > >- > > the left image is the minc output I am getting, the right is the > > original > > nifti file.) > > Any tips on solving this problem? > > > > Thank you. > > > > > > Best, > > Lisa > > _______________________________________________ > > 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 graeme.okeefe at petnm.unimelb.edu.au Wed Sep 14 07:25:51 2011 From: graeme.okeefe at petnm.unimelb.edu.au (Graeme O'Keefe) Date: Wed, 14 Sep 2011 21:25:51 +1000 Subject: [MINC-users] using pyminc to convert a philips/ugm file Message-ID: <0ADDB3D2-2D7C-4DB5-B382-C88E2852FA84@petnm.unimelb.edu.au> Hi, I'm trying to use pyminc to convert a dynamic PET scan in Philips format (UGM) to minc2. The time-step is not constant. Would anyone be able to tell me how I would save a "tspace" vector containing the times of each frame using volumeFromDescription? btw, has anyone compiled minc2 for OS X 10.7? cheers, Graeme From a.janke at gmail.com Wed Sep 14 20:52:59 2011 From: a.janke at gmail.com (Andrew Janke) Date: Thu, 15 Sep 2011 10:52:59 +1000 Subject: [MINC-users] using pyminc to convert a philips/ugm file In-Reply-To: <0ADDB3D2-2D7C-4DB5-B382-C88E2852FA84@petnm.unimelb.edu.au> References: <0ADDB3D2-2D7C-4DB5-B382-C88E2852FA84@petnm.unimelb.edu.au> Message-ID: Hi Graeme, On 14 September 2011 21:25, Graeme O'Keefe wrote: > I'm trying to use pyminc to convert a dynamic PET scan in Philips format (UGM) to minc2. > > The time-step is not constant. > > Would anyone be able to tell me how I would save a "tspace" vector containing the times of each frame using volumeFromDescription? I can't answer for pyminc but see you don't have an answer yet the pyminc types so in the meantime this might work for you as a hack solution via a system() call. From the command line you would do this: mincinfo -varvalue time out.mnc This will return a newline separated vector, providing that mincinfo -attvalue time:spacing out.mnc returns 'irregular'. a From graeme.okeefe at petnm.unimelb.edu.au Fri Sep 16 00:57:05 2011 From: graeme.okeefe at petnm.unimelb.edu.au (Graeme O'Keefe) Date: Fri, 16 Sep 2011 14:57:05 +1000 Subject: [MINC-users] using pyminc to convert a philips/ugm file In-Reply-To: References: <0ADDB3D2-2D7C-4DB5-B382-C88E2852FA84@petnm.unimelb.edu.au> Message-ID: thanks Andrew, for now, my workaround is to use rawtominc. ie. something like this. cat p2151s0_VAL_PIBdy28.raw | rawtominc -float -ofloat -xstep 2 -ystep 2 -zstep 2 -xstart -128 -ystart -128 -zstart -45 p2151s0_VAL_PIBdy28.mnc 28 90 128 128 -frame_widths "30,30,30,30,60,60,60,60,60,60,60,60,60,180,180,180,300,300,300,300,300,300,300,300,300,300,600,600" -frame_times "0,30,60,90,120,180,240,300,360,420,480,540,600,660,840,1020,1200,1500,1800,2100,2400,2700,3000,3300,3600,3900,4200,4800" regards, Graeme On 15/09/2011, at 10:52 AM, Andrew Janke wrote: > Hi Graeme, > > On 14 September 2011 21:25, Graeme O'Keefe > wrote: >> I'm trying to use pyminc to convert a dynamic PET scan in Philips format (UGM) to minc2. >> >> The time-step is not constant. >> >> Would anyone be able to tell me how I would save a "tspace" vector containing the times of each frame using volumeFromDescription? > > I can't answer for pyminc but see you don't have an answer yet the > pyminc types so in the meantime this might work for you as a hack > solution via a system() call. From the command line you would do this: > > mincinfo -varvalue time out.mnc > > This will return a newline separated vector, providing that > > mincinfo -attvalue time:spacing out.mnc > > returns 'irregular'. > > > a > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From jason at phenogenomics.ca Sun Sep 18 11:50:33 2011 From: jason at phenogenomics.ca (Jason Lerch) Date: Sun, 18 Sep 2011 11:50:33 -0400 Subject: [MINC-users] using pyminc to convert a philips/ugm file In-Reply-To: References: <0ADDB3D2-2D7C-4DB5-B382-C88E2852FA84@petnm.unimelb.edu.au> Message-ID: <52351154-00E7-4B09-B076-460D26B187B4@phenogenomics.ca> I've never tried this with pyminc, and never had the occasion to given the data I use. It should be quite doable though, and if it isn't then it's a bug to be fixed. Could you make a (ideally small) volume accessible that shows the outcome you would like and maybe provide some pseudo-code describing how you would like to create that kind of a volume in pyminc? Thanks! Jason On 2011-09-16, at 12:57 AM, Graeme O'Keefe wrote: > thanks Andrew, > > for now, my workaround is to use rawtominc. > > ie. something like this. > > cat p2151s0_VAL_PIBdy28.raw | rawtominc -float -ofloat -xstep 2 -ystep 2 -zstep 2 -xstart -128 -ystart -128 -zstart -45 p2151s0_VAL_PIBdy28.mnc 28 90 128 128 -frame_widths "30,30,30,30,60,60,60,60,60,60,60,60,60,180,180,180,300,300,300,300,300,300,300,300,300,300,600,600" -frame_times "0,30,60,90,120,180,240,300,360,420,480,540,600,660,840,1020,1200,1500,1800,2100,2400,2700,3000,3300,3600,3900,4200,4800" > > regards, > > Graeme > > On 15/09/2011, at 10:52 AM, Andrew Janke wrote: > >> Hi Graeme, >> >> On 14 September 2011 21:25, Graeme O'Keefe >> wrote: >>> I'm trying to use pyminc to convert a dynamic PET scan in Philips format (UGM) to minc2. >>> >>> The time-step is not constant. >>> >>> Would anyone be able to tell me how I would save a "tspace" vector containing the times of each frame using volumeFromDescription? >> >> I can't answer for pyminc but see you don't have an answer yet the >> pyminc types so in the meantime this might work for you as a hack >> solution via a system() call. From the command line you would do this: >> >> mincinfo -varvalue time out.mnc >> >> This will return a newline separated vector, providing that >> >> mincinfo -attvalue time:spacing out.mnc >> >> returns 'irregular'. >> >> >> 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 matthijs at phenogenomics.ca Thu Sep 22 11:26:19 2011 From: matthijs at phenogenomics.ca (Matthijs van Eede) Date: Thu, 22 Sep 2011 11:26:19 -0400 Subject: [MINC-users] compiling minc tools for ubuntu 11.04 In-Reply-To: <4E2DDBA4.8040309@gmail.com> References: <4E2DDBA4.8040309@gmail.com> Message-ID: <4E7B539B.80904@phenogenomics.ca> Hi Vladimir, I am building the minc tools on Ubuntu 10.04 and I am getting quite different results from nu_correct depending on whether or not the ebtks patch is applied. Using the same settings for nu_correct (or nu_estimate), the version where the patch is applied delivers an intensity mapping that is uniform (5.192e+33 everywhere). Does the patch require different settings for nu_correct? Or should it not be applied on Ubuntu 10.04? Thanks, Matthijs On 11-07-25 05:09 PM, Vladimir S. FONOV wrote: > Hello Everybody, > > after building minc tools for Ubuntu 11.04 ,I came across a problem > with compiling N3 caused by "bad" template definitions in ebtks, see > patch: > http://www.bic.mni.mcgill.ca/~vfonov/software/ebtks-1.6.4-VF.patch.gz > which fixes the error. > > Also, to build Display ( 1.5.0) you have to run following commands: > > aclocal -I m4 > autoheader > libtoolize --automake > automake --add-missing --copy > autoconf > > and then usual ./configure ...;make;make install > > alternatively - apply patch: > > http://www.bic.mni.mcgill.ca/~vfonov/software/Display-1.5.0-VF.patch.gz > From jennika.soles at gmail.com Tue Sep 27 21:04:00 2011 From: jennika.soles at gmail.com (Jennika Soles) Date: Tue, 27 Sep 2011 21:04:00 -0400 Subject: [MINC-users] Calculating an FDR threshold Message-ID: Hi All, Does anyone know if there is a particular method of calculating an FDR threshold for a VBM t-stat map generated using glim_image? Would using the tool in fMRIstat be acceptable? Thanks! From mishkind at gmail.com Tue Sep 27 23:23:53 2011 From: mishkind at gmail.com (Mishkin Derakhshan) Date: Tue, 27 Sep 2011 23:23:53 -0400 Subject: [MINC-users] Calculating an FDR threshold In-Reply-To: References: Message-ID: Hi Jennika, I've never used glim_image or fMRIstat, but I have computed FDR thresholds using R and the mni.cortical.statistics library. If you can get the VBM t-stat map that is generated from glim_image, into a simple text file listing each t-stat per row, then you can use the following: 1. Install R and library on ubuntu: sudo apt-get install r-base-core then download the mni.cortical.statistics library to /tmp/ http://www.bic.mni.mcgill.ca/users/mishkin/files/mni.cortical.statistics.0.9.0_patched.tar.gz cd /tmp tar xvzf mni.cortical.statistics.0.9.0_patched.tar.gz mkdir /home/mishkin/R_LIBS (or wherever you want to keep your R libraries) R CMD INSTALL --library=/home/mishkin/R_LIBS/ mni.cortical.statistics export R_LIBS=/home/mishkin/R_LIBS 2. Calculate the FDR in R R library(mni.cortical.statistics) tstats =scan("my_file_of_tstats.txt") q <- mni.compute.FDR(tstats, df=12, fdr=0.05) write(q,"fdr_threshold_output.txt",1) where: "my_file_of_tstats.txt" looks like this: -2.23 -2.24 ... -1.93 0.32 "df = 12" means 12 degrees of freedom. usually the N of each group -2 "fdr = 0.05" means use an fdr threshold of 0.05 "fdr_threshold_output.txt" will be an output file containing a number that indicates the fdr threshold t-stat: -2.1 So, this would mean that all t-stats less than -2.1 would be deemed significant using an FDR of 0.05. hth, mishkin On Tue, Sep 27, 2011 at 9:04 PM, Jennika Soles wrote: > Hi All, > > Does anyone know if there is a particular method of calculating an FDR > threshold for a VBM t-stat map generated using glim_image? Would using the > tool in fMRIstat be acceptable? > > Thanks! > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From mishkind at gmail.com Tue Sep 27 23:46:29 2011 From: mishkind at gmail.com (Mishkin Derakhshan) Date: Tue, 27 Sep 2011 23:46:29 -0400 Subject: [MINC-users] mni.cortical.statistics patch Message-ID: Hi, I'm not sure if something has changed in the latest R versions, but version 2.12.1, combined with the mni.cortical.statistics (0.9.0) that is on the cvs, spits out an error when you try to use the mni.compute.FDR function: "multi-argument returns are not permitted". Indeed, looking at line 860 of vertex_glim.R, the return statement is return(fdr.threshold,q) I am no expert in R, but here is a solution I found through the infinite wisdom of google: return(list(fdr.threshold,q)) This will of course change the way people interfaced with mni.compute.FDR ie, to get the threshold, instead of: q<-mni.compute.FDR(...) q$fdr.threshold you need to use q<-mni.compute.FDR(...) q[1] Jason, this is really your project so I'll let you make the appropriate changes. mishkin p.s. once this is sorted. can I suggest putting a version in packages.bic.mni.mcgill.ca/tgz/, and maybe including this as an INSTALL: R CMD INSTALL --library=/path/to/useful/extra/libraries/for/R/ mni.cortical.statistics export R_LIBS=/path/to/useful/extra/libraries/for/R/ From jason at phenogenomics.ca Wed Sep 28 07:32:47 2011 From: jason at phenogenomics.ca (Jason Lerch) Date: Wed, 28 Sep 2011 07:32:47 -0400 Subject: [MINC-users] mni.cortical.statistics patch In-Reply-To: References: Message-ID: <93B7D18E-A28C-4E51-A310-E498400C6FB9@phenogenomics.ca> I haven't touched mni.cortical.statistics in ages, but I'll take a peek to see if I can reproduce the bug and put out a patch. Thanks for pointing it out! Jason On 2011-09-27, at 11:46 PM, Mishkin Derakhshan wrote: > Hi, > I'm not sure if something has changed in the latest R versions, but > version 2.12.1, combined with the mni.cortical.statistics (0.9.0) that > is on the cvs, spits out an error when you try to use the > mni.compute.FDR function: > "multi-argument returns are not permitted". > > Indeed, looking at line 860 of vertex_glim.R, the return statement is > return(fdr.threshold,q) > > I am no expert in R, but here is a solution I found through the > infinite wisdom of google: > return(list(fdr.threshold,q)) > > This will of course change the way people interfaced with mni.compute.FDR > ie, to get the threshold, instead of: > q<-mni.compute.FDR(...) > q$fdr.threshold > > you need to use > q<-mni.compute.FDR(...) > q[1] > > Jason, this is really your project so I'll let you make the appropriate changes. > > mishkin > > p.s. once this is sorted. can I suggest putting a version in > packages.bic.mni.mcgill.ca/tgz/, and maybe including this as an > INSTALL: > R CMD INSTALL --library=/path/to/useful/extra/libraries/for/R/ > mni.cortical.statistics > export R_LIBS=/path/to/useful/extra/libraries/for/R/ > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From jason at phenogenomics.ca Wed Sep 28 07:45:26 2011 From: jason at phenogenomics.ca (Jason Lerch) Date: Wed, 28 Sep 2011 07:45:26 -0400 Subject: [MINC-users] Calculating an FDR threshold In-Reply-To: References: Message-ID: There are routines inside RMINC (a library in R) that can calculate the FDR for MINC volumes - mincFDR.default in particular. If you have R but not RMINC (and can't be bothered to install it), here's a moderately quick workaround (all this assumes a two tailed t-test; it's easy to adjust for another type of test): mincextract -ascii statsvol.mnc > stasvol.txt R > vol <- read.table('statsvol.txt')$V1 > pvals <- 2* pt(-abs(vol), df) # where df is your degrees of freedom > qvals <- p.adjust(pvals, 'fdr') > max(pvals[qvals<0.05]) # the p value corresponding to a 5% FDR > qt(max(pvals[qvals<0.05])/2, df) # the t value corresponding to a 5% FDR Using a mask is left as an exercise to the reader ;-) Jason On 2011-09-27, at 11:23 PM, Mishkin Derakhshan wrote: > Hi Jennika, > > I've never used glim_image or fMRIstat, but I have computed FDR > thresholds using R and the mni.cortical.statistics library. > > If you can get the VBM t-stat map that is generated from glim_image, > into a simple text file listing each t-stat per row, then you can use > the following: > > 1. Install R and library > on ubuntu: sudo apt-get install r-base-core > then download the mni.cortical.statistics library to /tmp/ > http://www.bic.mni.mcgill.ca/users/mishkin/files/mni.cortical.statistics.0.9.0_patched.tar.gz > cd /tmp > tar xvzf mni.cortical.statistics.0.9.0_patched.tar.gz > mkdir /home/mishkin/R_LIBS (or wherever you want to keep your R libraries) > R CMD INSTALL --library=/home/mishkin/R_LIBS/ mni.cortical.statistics > export R_LIBS=/home/mishkin/R_LIBS > > 2. Calculate the FDR in R > R > library(mni.cortical.statistics) > tstats =scan("my_file_of_tstats.txt") > q <- mni.compute.FDR(tstats, df=12, fdr=0.05) > write(q,"fdr_threshold_output.txt",1) > > where: > "my_file_of_tstats.txt" looks like this: > -2.23 > -2.24 > ... > -1.93 > 0.32 > > "df = 12" means 12 degrees of freedom. usually the N of each group -2 > "fdr = 0.05" means use an fdr threshold of 0.05 > > "fdr_threshold_output.txt" will be an output file containing a number > that indicates the fdr threshold t-stat: > -2.1 > > So, this would mean that all t-stats less than -2.1 would be deemed > significant using an FDR of 0.05. > > hth, > mishkin > > > On Tue, Sep 27, 2011 at 9:04 PM, Jennika Soles wrote: >> Hi All, >> >> Does anyone know if there is a particular method of calculating an FDR >> threshold for a VBM t-stat map generated using glim_image? Would using the >> tool in fMRIstat be acceptable? >> >> Thanks! >> _______________________________________________ >> 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