From Nicolas.Guizard at bic.mni.mcgill.ca Thu May 17 18:06:50 2012 From: Nicolas.Guizard at bic.mni.mcgill.ca (nicolas guizard) Date: Thu, 17 May 2012 18:06:50 -0400 Subject: [MINC-users] R/RMINC Linear Mixed-Effect Models with mincApply Message-ID: Hello Minc-Users, I am trying to use R with Rminc to compute a mixed-effect model on longitudinal Jacobians of multiple subjects with multiple visits. I didn't find a mincfunction in the Rminc library to do so, therefore, I used another library (http://cran.r-project.org/web/packages/nlme/index.html ). But I am not sure how to use the mincApply function to perform the analyses with the different variables. Here is what I do but doesn't work: > f <- function(x) { > lme(x ~ 1 + gf$Visit + gf$Treatment, random = ~ gf$ID) > } > lmemodel <- mincApply(gf$File, quote(f(x)), mask) > Error in eval(expr, envir, enclos) : object 'ID' not found Where gf is my data table. Regards, Nicolas From maudette at odu.edu Thu May 17 18:15:33 2012 From: maudette at odu.edu (Audette, Michel A.) Date: Thu, 17 May 2012 18:15:33 -0400 Subject: [MINC-users] mincresample: possible to combine 2 or more anistropic volumes to reconstruct one high-res isotropic volume? In-Reply-To: References: Message-ID: <5D094B4A0B15E441811066CCC54AE4FC263E6C0AE8@MUFASA.ts.odu.edu> Dear MINC users, I have a student working on spine modeling, and we have some CT datasets with complementary anistropic sampling orientations: e.g.: one with sub-mm in x-y, and 2 mm (as I recall) in z; a second that is sub-mm in x-z, 2mm in y; and a third, that is sub-mm in y-z, 2mm in x. Is there a means of using mincresample, or some other MINC tool, that leads to a combination of several datasets to produce one sub-mm isotropic volume, with optimal reconstruction qualities? Thanks for your kind consideration. Best wishes, Michel Michel Audette, Ph.D. Assistant Professor, Department of Modeling, Simulation and Visualization Engineering, Old Dominion University, Norfolk, VA. From a.janke at gmail.com Thu May 17 19:23:45 2012 From: a.janke at gmail.com (Andrew Janke) Date: Fri, 18 May 2012 09:23:45 +1000 Subject: [MINC-users] mincresample: possible to combine 2 or more anistropic volumes to reconstruct one high-res isotropic volume? In-Reply-To: <5D094B4A0B15E441811066CCC54AE4FC263E6C0AE8@MUFASA.ts.odu.edu> References: <5D094B4A0B15E441811066CCC54AE4FC263E6C0AE8@MUFASA.ts.odu.edu> Message-ID: Hi Michel, > I have a student working on spine modeling, and we have some CT datasets with complementary anistropic sampling orientations: e.g.: one with sub-mm in x-y, and 2 mm (as I recall) in z; a second that is sub-mm in x-z, 2mm in y; and a third, that is sub-mm in y-z, 2mm in x. > > Is there a means of using mincresample, or some other MINC tool, that leads to a combination of several datasets to produce one sub-mm isotropic volume, with optimal reconstruction qualities? Years ago a wrote a thing called volregrid to do some k-space regridding of sodium imaging data. I used it a bit for that but others at the BIC abused it to do pretty much exactly what you are after for ultrasound data. You can get it here: https://github.com/andrewjanke/volregrid You'd run it something like this: volregrid -xnelem -ynelem ... -xstart ... -xstep ... in1.mnc in2.mnc out.mnc I'd probably also use -gaussian and a leave everything else at the defaults as your data is sort of "head-ish" in resolution. there are others on here who have used volregrid so they might pipe up with some help also. a From maudette at odu.edu Thu May 17 21:43:33 2012 From: maudette at odu.edu (Audette, Michel A.) Date: Thu, 17 May 2012 21:43:33 -0400 Subject: [MINC-users] mincresample: possible to combine 2 or more anistropic volumes to reconstruct one high-res isotropic volume? In-Reply-To: References: <5D094B4A0B15E441811066CCC54AE4FC263E6C0AE8@MUFASA.ts.odu.edu>, Message-ID: <5D094B4A0B15E441811066CCC54AE4FC263E6C0AE9@MUFASA.ts.odu.edu> Hi Andrew, thanks, you always have a great response that never disappoints me. I'll have my student do some dcm2mnc's, download minctools as well as this, and play around with it. I have high hopes. Cheers, Michel Michel Audette, Ph.D. Assistant Professor, Department of Modeling, Simulation and Visualization Engineering, Old Dominion University, Norfolk, VA. ________________________________________ From: minc-users-bounces at bic.mni.mcgill.ca [minc-users-bounces at bic.mni.mcgill.ca] On Behalf Of Andrew Janke [a.janke at gmail.com] Sent: Thursday, May 17, 2012 7:23 PM To: MINC users mailing list Subject: Re: [MINC-users] mincresample: possible to combine 2 or more anistropic volumes to reconstruct one high-res isotropic volume? Hi Michel, > I have a student working on spine modeling, and we have some CT datasets with complementary anistropic sampling orientations: e.g.: one with sub-mm in x-y, and 2 mm (as I recall) in z; a second that is sub-mm in x-z, 2mm in y; and a third, that is sub-mm in y-z, 2mm in x. > > Is there a means of using mincresample, or some other MINC tool, that leads to a combination of several datasets to produce one sub-mm isotropic volume, with optimal reconstruction qualities? Years ago a wrote a thing called volregrid to do some k-space regridding of sodium imaging data. I used it a bit for that but others at the BIC abused it to do pretty much exactly what you are after for ultrasound data. You can get it here: https://github.com/andrewjanke/volregrid You'd run it something like this: volregrid -xnelem -ynelem ... -xstart ... -xstep ... in1.mnc in2.mnc out.mnc I'd probably also use -gaussian and a leave everything else at the defaults as your data is sort of "head-ish" in resolution. there are others on here who have used volregrid so they might pipe up with some help also. a _______________________________________________ MINC-users at bic.mni.mcgill.ca http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users -- BEGIN-ANTISPAM-VOTING-LINKS ------------------------------------------------------ Teach CanIt if this mail (ID 662485216) is spam: Spam: https://www.spamtrap.odu.edu/b.php?i=662485216&m=23ba2db54d4a&t=20120517&c=s Not spam: https://www.spamtrap.odu.edu/b.php?i=662485216&m=23ba2db54d4a&t=20120517&c=n Forget vote: https://www.spamtrap.odu.edu/b.php?i=662485216&m=23ba2db54d4a&t=20120517&c=f ------------------------------------------------------ END-ANTISPAM-VOTING-LINKS From jason at phenogenomics.ca Fri May 18 08:17:55 2012 From: jason at phenogenomics.ca (Jason Lerch) Date: Fri, 18 May 2012 08:17:55 -0400 Subject: [MINC-users] R/RMINC Linear Mixed-Effect Models with mincApply In-Reply-To: References: Message-ID: Howdy all, RMINC has a mincLme function in it (which is sadly undocumented) - that should do the trick for you, but as a warning it is rather slow. Rewriting that code in C (as was done for mincLm) is somewhere on the todo list ... Jason On 2012-05-17, at 6:06 PM, nicolas guizard wrote: > Hello Minc-Users, > > I am trying to use R with Rminc to compute a mixed-effect model on > longitudinal Jacobians of multiple subjects with multiple visits. > > I didn't find a mincfunction in the Rminc library to do so, therefore, I > used another library (http://cran.r-project.org/web/packages/nlme/index.html > ). > But I am not sure how to use the mincApply function to perform the analyses > with the different variables. > > Here is what I do but doesn't work: > >> f <- function(x) { >> lme(x ~ 1 + gf$Visit + gf$Treatment, random = ~ gf$ID) >> } > >> lmemodel <- mincApply(gf$File, quote(f(x)), mask) > >> Error in eval(expr, envir, enclos) : object 'ID' not found > > > Where gf is my data table. > > Regards, > Nicolas > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From n.guizard at gmail.com Fri May 18 11:32:48 2012 From: n.guizard at gmail.com (nicolas guizard) Date: Fri, 18 May 2012 11:32:48 -0400 Subject: [MINC-users] R/RMINC Linear Mixed-Effect Models with mincApply In-Reply-To: References: Message-ID: Thanks, it seems to be called 'mincSlowLme'. Nicolas On Fri, May 18, 2012 at 8:17 AM, Jason Lerch wrote: > Howdy all, > > RMINC has a mincLme function in it (which is sadly undocumented) - that > should do the trick for you, but as a warning it is rather slow. Rewriting > that code in C (as was done for mincLm) is somewhere on the todo list ... > > Jason > > On 2012-05-17, at 6:06 PM, nicolas guizard < > Nicolas.Guizard at bic.mni.mcgill.ca> wrote: > > > Hello Minc-Users, > > > > I am trying to use R with Rminc to compute a mixed-effect model on > > longitudinal Jacobians of multiple subjects with multiple visits. > > > > I didn't find a mincfunction in the Rminc library to do so, therefore, I > > used another library ( > http://cran.r-project.org/web/packages/nlme/index.html > > ). > > But I am not sure how to use the mincApply function to perform the > analyses > > with the different variables. > > > > Here is what I do but doesn't work: > > > >> f <- function(x) { > >> lme(x ~ 1 + gf$Visit + gf$Treatment, random = ~ gf$ID) > >> } > > > >> lmemodel <- mincApply(gf$File, quote(f(x)), mask) > > > >> Error in eval(expr, envir, enclos) : object 'ID' not found > > > > > > Where gf is my data table. > > > > Regards, > > Nicolas > > _______________________________________________ > > 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.m.dubois at gmail.com Wed May 30 13:45:11 2012 From: jonathan.m.dubois at gmail.com (Jonathan DuBois) Date: Wed, 30 May 2012 13:45:11 -0400 Subject: [MINC-users] minimum cluster size Message-ID: <3C622EE4-0E80-4086-A24F-C6D740C6878E@gmail.com> Hi Minc Users, Does anyone have a script or method for setting a minimum cluster size for a minc image? I would like to only view significant voxels (greater than a specified p-value) in a cluster of 3 or more for a z or t map. Thanks in advance. Jon From a.janke at gmail.com Wed May 30 22:23:39 2012 From: a.janke at gmail.com (Andrew Janke) Date: Thu, 31 May 2012 12:23:39 +1000 Subject: [MINC-users] minimum cluster size In-Reply-To: <3C622EE4-0E80-4086-A24F-C6D740C6878E@gmail.com> References: <3C622EE4-0E80-4086-A24F-C6D740C6878E@gmail.com> Message-ID: Hi Jonathan, On 31 May 2012 03:45, Jonathan DuBois wrote: > Does anyone have a script or method for setting a minimum cluster size for a minc image? I would like to only view significant voxels (greater than a specified p-value) in a cluster of 3 or more for a z or t map. I don't know of a specific tool for this but here's what I'd do: # find all voxels above your threshold mincmath -gt -const tmap.mnc thresh.mnc # use mincmorph to find the groups (using a 3D 6 connectivity kernel) # mincmorph will order the groups by size. mincmorph -group -3D06 thresh.mnc groups.mnc # use mincstats to find the number of values in each group via a histogram mincstats -histogram hist.txt -discrete_histogram group.mnc Then look at hist.txt and find the group number that suits the number of voxels you want in each group. You can then find all groups greater than this by a simple threshold mincmath -gt -const group.mnc mask.mnc >From there you can just apply the final mask to your original data mincmath -mult tmap.mnc mask.mnc tmap-masked.mnc a From jonathan.m.dubois at gmail.com Thu May 31 17:50:27 2012 From: jonathan.m.dubois at gmail.com (Jonathan DuBois) Date: Thu, 31 May 2012 17:50:27 -0400 Subject: [MINC-users] minimum cluster size In-Reply-To: References: Message-ID: Thanks Andrew, that worked well. On 2012-05-31, at 12:00 PM, minc-users-request at bic.mni.mcgill.ca wrote: > Send MINC-users mailing list submissions to > minc-users at bic.mni.mcgill.ca > > To subscribe or unsubscribe via the World Wide Web, visit > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > or, via email, send a message with subject or body 'help' to > minc-users-request at bic.mni.mcgill.ca > > You can reach the person managing the list at > minc-users-owner at bic.mni.mcgill.ca > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of MINC-users digest..." > > > Today's Topics: > > 1. minimum cluster size (Jonathan DuBois) > 2. Re: minimum cluster size (Andrew Janke) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 30 May 2012 13:45:11 -0400 > From: Jonathan DuBois > To: minc-users at bic.mni.mcgill.ca > Subject: [MINC-users] minimum cluster size > Message-ID: <3C622EE4-0E80-4086-A24F-C6D740C6878E at gmail.com> > Content-Type: text/plain; charset=us-ascii > > Hi Minc Users, > > Does anyone have a script or method for setting a minimum cluster size for a minc image? I would like to only view significant voxels (greater than a specified p-value) in a cluster of 3 or more for a z or t map. Thanks in advance. > > Jon > > ------------------------------ > > Message: 2 > Date: Thu, 31 May 2012 12:23:39 +1000 > From: Andrew Janke > To: MINC users mailing list > Subject: Re: [MINC-users] minimum cluster size > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > Hi Jonathan, > > On 31 May 2012 03:45, Jonathan DuBois wrote: >> Does anyone have a script or method for setting a minimum cluster size for a minc image? I would like to only view significant voxels (greater than a specified p-value) in a cluster of 3 or more for a z or t map. > > I don't know of a specific tool for this but here's what I'd do: > > # find all voxels above your threshold > mincmath -gt -const tmap.mnc thresh.mnc > > # use mincmorph to find the groups (using a 3D 6 connectivity kernel) > # mincmorph will order the groups by size. > mincmorph -group -3D06 thresh.mnc groups.mnc > > # use mincstats to find the number of values in each group via a histogram > mincstats -histogram hist.txt -discrete_histogram group.mnc > > Then look at hist.txt and find the group number that suits the number > of voxels you want in each group. You can then find all groups greater > than this by a simple threshold > > mincmath -gt -const group.mnc mask.mnc > >> From there you can just apply the final mask to your original data > > mincmath -mult tmap.mnc mask.mnc tmap-masked.mnc > > > > a > > > ------------------------------ > > _______________________________________________ > MINC-users mailing list > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > > End of MINC-users Digest, Vol 82, Issue 2 > ***************************************** From zijdenbos at gmail.com Thu May 31 23:51:55 2012 From: zijdenbos at gmail.com (Alex Zijdenbos) Date: Thu, 31 May 2012 23:51:55 -0400 Subject: [MINC-users] default slice min/max in mincreshape? Message-ID: Hi all, I just ran into something that had me stumped for a while: a mincreshape call that set all values in the reshaped volume to 0. In the end, turned out that this was due to slice scaling again (sigh). My source volume is a PET volume, byte 0-255, that comes out of dcm2mnc with slice maxima like so: image-max = 0.000246520439341603, 0.000163440197211826, 0.000214308078508676, 0.000180133543411815, 0.000249790729781494, ... 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: image-max = 1, 1, 1, 1, 1, 0.000246520439341603, 0.000163440197211826, 0.000214308078508676, 0.000180133543411815, 0.000249790729781494, ... (all image-mins values are 0). Given that the this is a byte volume, setting a [0,1] range while the actual image data has a range of [0,2e-4], well, squashes that data into oblivion :-) 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. Thanks, -- Alex