From nikelski at bic.mni.mcgill.ca Tue Jan 4 03:32:00 2011 From: nikelski at bic.mni.mcgill.ca (EJ Nikelski) Date: Tue, 4 Jan 2011 00:32:00 -0800 Subject: [MINC-users] ecattominc seg fault on 64-bit Lucid Message-ID: Hi All, I've been using ecattominc to convert 7-frame dynamic volumes (acquired at the MNI) to minc for some time, without any trouble. Today, however, I installed the minc tools on to a relatively fresh 64-bit Lucid system, and I'm now getting seg faults (minc-2.1.00). The abort occurs consistently while opening the ecat file and appears to occur within the "/* Save the offsets */" loop of function ecat_read_directory (ecat_file.c). The precise loop number at which the seg fault occurs is variable, suggesting that this is related either to an uninitialized variable, or some 32-bit versus 64-bit issue (the same ecat volume does not cause a seg fault on our 32-bit system). Any ideas or suggestions? I'm willing to test any suggested code modifications. I've already done a fair bit of poking around and re-compiling, but my knowledge of ecat header internals is lacking. Thanks, -jim -- ================================= Jim Nikelski, Ph.D. Postdoctoral Research Fellow Bloomfield Centre for Research in Aging Lady Davis Institute for Medical Research Sir Mortimer B. Davis - Jewish General Hospital McGill University From a.janke at gmail.com Wed Jan 5 00:44:18 2011 From: a.janke at gmail.com (Andrew Janke) Date: Wed, 5 Jan 2011 15:44:18 +1000 Subject: [MINC-users] simulating real and imaginary images -- does it work? In-Reply-To: References: Message-ID: Hi You can get mrisim from here: http://packages.bic.mni.mcgill.ca/tgz/ And yes it is for simulation, it's what is behind Brainweb. -- Andrew Janke (a.janke at gmail.com || http://a.janke.googlepages.com/) Canberra->Australia +61 (402) 700 883 On 24 December 2010 01:41, Friedrich Dong wrote: > Hi Andrew, > > I meant BrainWeb. But how can I get mrisim? Is it for MRI simulation? From mihovil at hiim.hr Mon Jan 10 03:12:54 2011 From: mihovil at hiim.hr (Mihovil Pletikos) Date: Mon, 10 Jan 2011 09:12:54 +0100 Subject: [MINC-users] only two windows of displa Message-ID: List I have a problem with display.... all other parts of minc tools work but display when started opens only two windows, the "keyboard-like" one and 3d view window, and load and save options are not available.... I'm using Mint Debian edition 32 bit on my asus g73jh laptop... and i installed everything from lenny repositories... I would really appreciate your help.... thank you :) Mihovil Pletikos, MD Croatian Institute for Brain Research School of Medicine University of Zagreb Croatia From nikelski at bic.mni.mcgill.ca Tue Jan 18 15:13:37 2011 From: nikelski at bic.mni.mcgill.ca (EJ Nikelski) Date: Tue, 18 Jan 2011 12:13:37 -0800 Subject: [MINC-users] ecattominc seg fault on 64-bit Lucid In-Reply-To: References: Message-ID: Hi List, OK, the ecattominc problem has been identified and fixed (thanks to Claude for consultation). It is indeed a 64-bit issue. Specifically, ecattominc freads 32-bit ints from the ecat file into a IO buffer typed as (long). This works spiffingly on a 32-bit ILP architecture, but less so with 64-bit longs in which case 2 ints are read into a single long, resulting in corruption. This main solution is to fix the buffer type to int32_t. A few additional downstream changes are also required. I'm sending this to minc-users, since it's pretty easy to get bitten by this bug. You'll see the problem if you: (1) use ecattominc (2) use a 64-bit OS (3) process dynamic volumes I've tested the fix on > 100 dynamic volumes, and all looks OK. Now I just need a minc-dev with commit privileges to contact me, and I'll happily send the diffs their way for inclusion in the next minc build. Cheers, -jim On Tue, Jan 4, 2011 at 12:32 AM, EJ Nikelski wrote: > Hi All, > > ? I've been using ecattominc to convert 7-frame dynamic volumes > (acquired at the MNI) to minc for some time, without any trouble. > Today, however, I installed the minc tools on to a relatively fresh > 64-bit Lucid system, and I'm now getting seg faults (minc-2.1.00). The > abort occurs consistently while opening the ecat file and appears to > occur within the "/* Save the offsets */" loop of function > ecat_read_directory (ecat_file.c). The precise loop number at which > the seg fault occurs is variable, suggesting that this is related > either to an uninitialized variable, or some 32-bit versus 64-bit > issue (the same ecat volume does not cause a seg fault on our 32-bit > system). > > ?Any ideas or suggestions? ?I'm willing to test any suggested code > modifications. ?I've already done a fair bit of poking around and > re-compiling, but my knowledge of ecat header internals is lacking. > > Thanks, > > -jim > > -- > ================================= > Jim Nikelski, Ph.D. > Postdoctoral Research Fellow > Bloomfield Centre for Research in Aging > Lady Davis Institute for Medical Research > Sir Mortimer B. Davis - Jewish General Hospital > McGill University > -- ================================= Jim Nikelski, Ph.D. Postdoctoral Research Fellow Bloomfield Centre for Research in Aging Lady Davis Institute for Medical Research Sir Mortimer B. Davis - Jewish General Hospital McGill University From Nicolas.Guizard at bic.mni.mcgill.ca Thu Jan 20 12:15:29 2011 From: Nicolas.Guizard at bic.mni.mcgill.ca (nicolas guizard) Date: Thu, 20 Jan 2011 12:15:29 -0500 Subject: [MINC-users] Vector field visualization from grid files Message-ID: Hello Minc-users, I would like to visualize vector field of non-linear registration grid file onto the corresponding 3D anatomic image. Is there a tool which could allow me to do that? Is Viewnup available for a Debian 64-bit machine? Thank you for your help, Nicolas From lrisa87 at uw.edu Thu Jan 20 13:00:16 2011 From: lrisa87 at uw.edu (Lisa F. Akiyama) Date: Thu, 20 Jan 2011 10:00:16 -0800 Subject: [MINC-users] "register" command Message-ID: Hello, I am using MINC 2.0.18 on an Ubuntu system. I am facing issues using the "register" command. The error that I receive is as follows: > X Error of failed request: BadMatch (invalid parameter attributes) > Major opcode of failed request: 128 (GLX) > Minor opcode of failed request: 26 (X_GLXMakeContextCurrent) > Serial number of failed request: 48 > Current serial number in output stream: 48 > However, when I run "register -help", I get the proper messages and no errors. Could someone guide me on how to resolve this problem? Thank you. Best, Lisa ______________________________ Lisa F. Akiyama Research Study Assistant Institute for Learning & Brain Sciences (I-LABS) University of Washington P Please consider the environment before printing this e-mail. From jason at phenogenomics.ca Thu Jan 20 14:06:03 2011 From: jason at phenogenomics.ca (Jason Lerch) Date: Thu, 20 Jan 2011 14:06:03 -0500 Subject: [MINC-users] introducing pyminc! Message-ID: <2003CC93-E84C-4301-A9AB-0122A7B684CD@phenogenomics.ca> Greetings all mincers, Long overdue, and promised before but never delivered, I finally released my python/minc interface. It's very intelligently called pyminc. What is it? A way to read MINC2 files in python using the numpy arrays library. How do you install it? Great question - see here: http://en.wikibooks.org/wiki/MINC/Tutorials/InstallingPyminc And how does one use it? I thought you'd never ask: http://en.wikibooks.org/wiki/MINC/Tutorials/PythonExample http://en.wikibooks.org/wiki/MINC/Tutorials/PythonSliceLoop And for all you Perl/C geeks and, even worse, folks who believe coding in Matlab should not be immediately and painfully punished - why would you want to use python and pyminc at all? See here for an illustration of the different and wonderful ways you can use python to write fast numeric code: http://en.wikibooks.org/wiki/MINC/Tutorials/NumericPyminc All the code is hosted on launchpad, so contributions welcome! The next task is add proper MINC header manipulation support ... Jason From nic.kassis at gmail.com Thu Jan 20 14:18:21 2011 From: nic.kassis at gmail.com (Nicolas Kassis) Date: Thu, 20 Jan 2011 14:18:21 -0500 Subject: [MINC-users] introducing pyminc! In-Reply-To: <2003CC93-E84C-4301-A9AB-0122A7B684CD@phenogenomics.ca> References: <2003CC93-E84C-4301-A9AB-0122A7B684CD@phenogenomics.ca> Message-ID: Hi Jason, That could prove useful for my little project right! Thanks a lot :) I've been building a minc library in ruby but it's incredibly slow ;p Nic On Thu, Jan 20, 2011 at 2:06 PM, Jason Lerch wrote: > Greetings all mincers, > > Long overdue, and promised before but never delivered, I finally released my python/minc interface. It's very intelligently called pyminc. What is it? A way to read MINC2 files in python using the numpy arrays library. How do you install it? Great question - see here: > > http://en.wikibooks.org/wiki/MINC/Tutorials/InstallingPyminc > > And how does one use it? I thought you'd never ask: > > http://en.wikibooks.org/wiki/MINC/Tutorials/PythonExample > http://en.wikibooks.org/wiki/MINC/Tutorials/PythonSliceLoop > > And for all you Perl/C geeks and, even worse, folks who believe coding in Matlab should not be immediately and painfully punished - why would you want to use python and pyminc at all? See here for an illustration of the different and wonderful ways you can use python to write fast numeric code: > > http://en.wikibooks.org/wiki/MINC/Tutorials/NumericPyminc > > All the code is hosted on launchpad, so contributions welcome! The next task is add proper MINC header manipulation support ... > > Jason > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > -- ----------------- Nicolas Kassis From a.janke at gmail.com Thu Jan 20 17:55:16 2011 From: a.janke at gmail.com (Andrew Janke) Date: Fri, 21 Jan 2011 08:55:16 +1000 Subject: [MINC-users] "register" command In-Reply-To: References: Message-ID: Hi Lisa > I am using MINC 2.0.18 on an Ubuntu system. Which version of register are you running? $ register -version Should return register: Version: 1.4.0 > I am facing issues using the "register" command. The error that I receive is > as follows: >> X Error of failed request: ?BadMatch (invalid parameter attributes) >> ? Major opcode of failed request: ?128 (GLX) >> ? Minor opcode of failed request: ?26 (X_GLXMakeContextCurrent) >> ? Serial number of failed request: ?48 >> ? Current serial number in output stream: ?48 This usually means that your hardware doesn't support Hardware OpenGL rendering (rare these days) or that more likely you dont have the OpenGL software emulation layer installed. This is called freeglut on a Ubuntu system. I'd try to install them as such: $ sudo apt-get install freeglut3 -- Andrew Janke (a.janke at gmail.com || http://a.janke.googlepages.com/) Brisbane->Australia +61 (402) 700 883 From lrisa87 at uw.edu Thu Jan 20 19:16:15 2011 From: lrisa87 at uw.edu (Lisa F. Akiyama) Date: Thu, 20 Jan 2011 16:16:15 -0800 Subject: [MINC-users] "register" command In-Reply-To: References: Message-ID: Hi Andrew, Apparently I am running register 1.3.5 (on Ubuntu 11.04). I tried installing freeglut3, but I had it already. Is the issue related to the older version of register? Thanks. Best, Lisa ______________________________ Lisa F. Akiyama Research Study Assistant Institute for Learning & Brain Sciences (I-LABS) University of Washington P Please consider the environment before printing this e-mail. On Thu, Jan 20, 2011 at 2:55 PM, Andrew Janke wrote: > Hi Lisa > > > I am using MINC 2.0.18 on an Ubuntu system. > > Which version of register are you running? > > $ register -version > > Should return > > register: Version: 1.4.0 > > > I am facing issues using the "register" command. The error that I receive > is > > as follows: > >> X Error of failed request: BadMatch (invalid parameter attributes) > >> Major opcode of failed request: 128 (GLX) > >> Minor opcode of failed request: 26 (X_GLXMakeContextCurrent) > >> Serial number of failed request: 48 > >> Current serial number in output stream: 48 > > This usually means that your hardware doesn't support Hardware OpenGL > rendering (rare these days) or that more likely you dont have the > OpenGL software emulation layer installed. This is called freeglut on > a Ubuntu system. I'd try to install them as such: > > $ sudo apt-get install freeglut3 > > -- > Andrew Janke > (a.janke at gmail.com || http://a.janke.googlepages.com/) > Brisbane->Australia +61 (402) 700 883 > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From a.janke at gmail.com Thu Jan 20 22:59:19 2011 From: a.janke at gmail.com (Andrew Janke) Date: Fri, 21 Jan 2011 13:59:19 +1000 Subject: [MINC-users] "register" command In-Reply-To: References: Message-ID: > Apparently I am running register 1.3.5 (on Ubuntu 11.04). > I tried installing freeglut3, but I had it already. Good good. > Is the issue related to the older version of register? It might be. In later releases of register the rendering mode is set to RGB by default instead of indexed mode. If this is your problem, running it as such should help: $ register -rgb ... a From a.janke at gmail.com Fri Jan 21 02:12:07 2011 From: a.janke at gmail.com (Andrew Janke) Date: Fri, 21 Jan 2011 17:12:07 +1000 Subject: [MINC-users] Display-1.5.0 build problem In-Reply-To: References: <201012210425.oBL4PdEh032709@cassio.bic.mni.mcgill.ca> Message-ID: Hi all, > In any case it hasn't been fun and took a lot more time than I had > hoped. ?Expect new Display packages for lucid and maverick shortly or > failing that for Christmas. Or perhaps a bit later, there's been a little bit too much water about this part of the world as of late... I have uploaded the new packages for Ubuntu Maverick here: http://packages.bic.mni.mcgill.ca/ubuntu-maverick/ Note that with the new build you will have to add this to your .bashrc or .bash_profile along with the PATH line: # MINC export PATH=$PATH:/usr/local/bic/bin export MANPATH=$MANPATH:/usr/local/bic/man:/usr/local/bic/share/man export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/bic/lib In time I will add this path tomfoolery to mincbundle but for now it is probably best to let individuals choose where they want their MINC from. Let me know if it breaks (again) for you and yes Mishkin and others I will attempt to find a i386 machine about here or make a VM and build some for you too... :) Thanks -- Andrew Janke (a.janke at gmail.com || http://a.janke.googlepages.com/) Brisbane->Australia +61 (402) 700 883 From lrisa87 at uw.edu Fri Jan 21 17:25:59 2011 From: lrisa87 at uw.edu (Lisa F. Akiyama) Date: Fri, 21 Jan 2011 14:25:59 -0800 Subject: [MINC-users] "register" command In-Reply-To: References: Message-ID: > > Hi Andrew, > > When I uninstalled Freesurfer and re-installed the newest Ubuntu-Maverick > MINC package that you had just uploaded yesterday, > register worked just fine. > However, once I installed FreeSurfer again, the same errors appear and when > I check the version of register, it is 1.3.5 now. > I'm suspecting that this is so because the register that comes with > FreeSurfer is an older version. > When I run register with the -rgb option, I only get a funky black&white > screen (please see attached). > Is there a way to have both FreeSurfer and MINC on my workstation, but have > the new functions of MINC (such as this register command) be newer? > Shall I just remove/replace the MINC commands of Freesurfer? > > Thank you. > > > Best, > Lisa > > > P Please consider the environment before printing this e-mail. > > > > On Thu, Jan 20, 2011 at 7:59 PM, Andrew Janke wrote: > >> > Apparently I am running register 1.3.5 (on Ubuntu 11.04). >> > I tried installing freeglut3, but I had it already. >> >> Good good. >> >> > Is the issue related to the older version of register? >> >> It might be. In later releases of register the rendering mode is set >> to RGB by default instead of indexed mode. >> >> If this is your problem, running it as such should help: >> >> $ register -rgb ... >> >> >> a >> _______________________________________________ >> MINC-users at bic.mni.mcgill.ca >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >> > > From fling at pet.rh.dk Mon Jan 24 07:57:48 2011 From: fling at pet.rh.dk (Flemming Littrup Andersen) Date: Mon, 24 Jan 2011 13:57:48 +0100 Subject: [MINC-users] Segfault in dcm2mnc on PET data from the Siemens mCT Message-ID: We have been using dcm2mnc for many years to convert our Siemens PET images to Minc. dcm2mnc is now failing with segfault after a scanner upgrade to Siemens newest PET scanner, the mCT PET/CT with TOF. This is the case both for minc 2.0 and 2.1. We have tried to localize the error - dcm2mnc is failing on a private tag (0029,1010) not present in older Siemens implementations (VR is OB accordint to Siemens Conformance statement) and we get the following: Using dcm2mnc on the new Siemens PET images results in a segmentation fault occuring at line 487 in acr_io.c: 485 ptr1 = (char *) input_value; 485 ptr2 = (char *) mach_value; 486 for (i=0; i Hi all, I just ran into this: $ mincconvert -compress 4 test.mnc test_compressed.mnc $ du -hs test*mnc 23M test_compressed.mnc 15M test.mnc That wasn't exactly the desired effect :) $ mincconvert -version program: 2.1.00 libminc: 2.1.00 netcdf : 3.6.1 of Dec 22 2010 16:29:38 $ HDF5 : 1.8.5 However, I get the exact same thing with a 2.0.18 version of mincconvert; and no matter what argument (1-9) I provide to the -compress option. So from what I can see, 'mincconvert -compress' does nothing at all? -- Alex From claude at bic.mni.mcgill.ca Mon Jan 24 16:04:56 2011 From: claude at bic.mni.mcgill.ca (Claude LEPAGE) Date: Mon, 24 Jan 2011 16:04:56 -0500 Subject: [MINC-users] mincconvert -compress broken? In-Reply-To: Message-ID: <201101242104.p0OL4uqw024163@cassio.bic.mni.mcgill.ca> Hi Alex, Interesting... Do you have environment variables like these that could interfere? MINC_FORCE_V2=1 MINC_COMPRESS=4 Try: "file test_compressed.mnc". Is it minc1 or minc2? Do you need -compress 4 -2 ? Usually, the best test is to gzip the file. What is the size of test.mnc.gz? minc2 achieves essentially the same compression ratio as gzip (for the data part). You can also forward me your test.mnc if you want me to have a look at it. I'm the one to blame for the current blocking strategy for compression in minc2. Claude > I just ran into this: > > $ mincconvert -compress 4 test.mnc test_compressed.mnc > $ du -hs test*mnc > 23M test_compressed.mnc > 15M test.mnc > > That wasn't exactly the desired effect :) > > $ mincconvert -version > program: 2.1.00 > libminc: 2.1.00 > netcdf : 3.6.1 of Dec 22 2010 16:29:38 $ > HDF5 : 1.8.5 > > However, I get the exact same thing with a 2.0.18 version of > mincconvert; and no matter what argument (1-9) I provide to the > -compress option. So from what I can see, 'mincconvert -compress' does > nothing at all? > > -- Alex > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From zijdenbos at gmail.com Mon Jan 24 17:25:23 2011 From: zijdenbos at gmail.com (Alex Zijdenbos) Date: Mon, 24 Jan 2011 17:25:23 -0500 Subject: [MINC-users] mincconvert -compress broken? In-Reply-To: <201101242104.p0OL4uqw024163@cassio.bic.mni.mcgill.ca> References: <201101242104.p0OL4uqw024163@cassio.bic.mni.mcgill.ca> Message-ID: Hi Claude, Thanks! And yes, it turns out that I needed 'mincconvert -compress 4 -2'. I had started with 'mincconvert -2 in.mnc out.mnc', with the environment vars below, thinking that it would simply (internally) compress my minc2 file. But I was told that my input file is already minc2, so I removed the -2; then added -compress. That caused mincconvert to generate a minc1 file, for which -compress doesn't work. I think the simple solution would be to add a check in minccompress that warns the user in case -compress was specified, but the output file is minc1? -- A > Interesting... > > Do you have environment variables like these that could interfere? > > MINC_FORCE_V2=1 > MINC_COMPRESS=4 > > Try: "file test_compressed.mnc". Is it minc1 or minc2? > > Do you need -compress 4 -2 ? > > Usually, the best test is to gzip the file. What is the size of test.mnc.gz? > minc2 achieves essentially the same compression ratio as gzip (for the data > part). > > You can also forward me your test.mnc if you want me to have a look at it. > I'm the one to blame for the current blocking strategy for compression in > minc2. > > Claude > >> I just ran into this: >> >> $ mincconvert -compress 4 test.mnc test_compressed.mnc >> $ du -hs test*mnc >> 23M ? ? test_compressed.mnc >> 15M ? ? test.mnc >> >> That wasn't exactly the desired effect :) >> >> $ mincconvert -version >> program: 2.1.00 >> libminc: 2.1.00 >> netcdf : 3.6.1 of Dec 22 2010 16:29:38 $ >> HDF5 ? : 1.8.5 >> >> However, I get the exact same thing with a 2.0.18 version of >> mincconvert; and no matter what argument (1-9) I provide to the >> -compress option. So from what I can see, 'mincconvert -compress' does >> nothing at all? >> >> -- Alex >> _______________________________________________ >> 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 a.janke at gmail.com Thu Jan 27 02:26:44 2011 From: a.janke at gmail.com (Andrew Janke) Date: Thu, 27 Jan 2011 17:26:44 +1000 Subject: [MINC-users] "register" command In-Reply-To: References: Message-ID: Ah, well then this is a PATH problem. Freesurfer installs its own entire install of an older version of MINC that will compete with your own MINC install. You will have to modify your .bashrc or .cshrc so that your PATH variable puts the MINC path first. Good luck. a On 22 January 2011 08:25, Lisa F. Akiyama wrote: >> >> Hi Andrew, >> >> When I uninstalled Freesurfer and re-installed the newest Ubuntu-Maverick >> MINC package that you had just uploaded yesterday, >> register worked just fine. >> However, once I installed FreeSurfer again, the same errors appear and when >> I check the version of register, it is 1.3.5 now. >> I'm suspecting that this is so because the register that comes with >> FreeSurfer is an older version. >> When I run register with the -rgb option, I only get a funky black&white >> screen (please see attached). >> Is there a way to have both FreeSurfer and MINC on my workstation, but have >> the new functions of MINC (such as this register command) be newer? >> Shall I just remove/replace the MINC commands of Freesurfer? >> >> Thank you. >> >> >> Best, >> Lisa >> >> >> P Please consider the environment before printing this e-mail. >> >> >> >> On Thu, Jan 20, 2011 at 7:59 PM, Andrew Janke wrote: >> >>> > Apparently I am running register 1.3.5 (on Ubuntu 11.04). >>> > I tried installing freeglut3, but I had it already. >>> >>> Good good. >>> >>> > Is the issue related to the older version of register? >>> >>> It might be. In later releases of register the rendering mode is set >>> to RGB by default instead of indexed mode. >>> >>> If this is your problem, running it as such should help: >>> >>> ? $ register -rgb ... >>> >>> >>> 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 a.janke at gmail.com Thu Jan 27 02:27:51 2011 From: a.janke at gmail.com (Andrew Janke) Date: Thu, 27 Jan 2011 17:27:51 +1000 Subject: [MINC-users] Vector field visualization from grid files In-Reply-To: References: Message-ID: Hi Nicholas On 21 January 2011 03:15, nicolas guizard wrote: > I would like to visualize vector field of non-linear registration grid file > onto the corresponding 3D anatomic image. > Is there a tool which could allow me to do that? Is Viewnup available for a > Debian 64-bit machine? There is no specific package for viewnup but it does build fine and I am happy to provide a source package if that works for you? a From vladimir.fonov at gmail.com Thu Jan 27 03:23:14 2011 From: vladimir.fonov at gmail.com (Vladimir S. FONOV) Date: Thu, 27 Jan 2011 03:23:14 -0500 Subject: [MINC-users] Vector field visualization from grid files In-Reply-To: References: Message-ID: Hello, that would be useful, I think. On Thu, Jan 27, 2011 at 2:27 AM, Andrew Janke wrote: > Hi Nicholas > > On 21 January 2011 03:15, nicolas guizard > wrote: >> I would like to visualize vector field of non-linear registration grid file >> onto the corresponding 3D anatomic image. >> Is there a tool which could allow me to do that? Is Viewnup available for a >> Debian 64-bit machine? > > There is no specific package for viewnup but it does build fine and I > am happy to provide a source package if that works for you? -- Best regards, ?Vladimir S. Fonov ~ vladimir fonov gmail com From a.janke at gmail.com Thu Jan 27 04:27:35 2011 From: a.janke at gmail.com (Andrew Janke) Date: Thu, 27 Jan 2011 19:27:35 +1000 Subject: [MINC-users] Vector field visualization from grid files In-Reply-To: References: Message-ID: On 27 January 2011 18:23, Vladimir S. FONOV wrote: > that would be useful, I think. OK then, here you are: http://packages.bic.mni.mcgill.ca/tgz/viewnup-2011-01-27.tar.gz It is a simple .tar.gz of the current CVS. You will first need to get gtkglext1-dev and popt $ sudo apt-get install libgtkglext1-dev libpopt-dev I am guessing the gtk+-2.0 and glib libraries will be included when you install the above then just edit the Makefile for your location of MINC (The INCLUDES and CFLAGS lines) and then make, there are a few GTK warnings you can ignore on the build, to install just take the viewnup binary, it is all self contained. Have fun. a From lrisa87 at uw.edu Thu Jan 27 12:52:29 2011 From: lrisa87 at uw.edu (Lisa F. Akiyama) Date: Thu, 27 Jan 2011 09:52:29 -0800 Subject: [MINC-users] "register" command In-Reply-To: References: Message-ID: Hi Andrew, Thanks for the tip! I edited the SetUpFreeSurfer.sh and "register" works now. Best, Lisa ______________________________ Lisa F. Akiyama Research Study Assistant Institute for Learning & Brain Sciences (I-LABS) University of Washington P Please consider the environment before printing this e-mail. On Wed, Jan 26, 2011 at 11:26 PM, Andrew Janke wrote: > Ah, well then this is a PATH problem. > > Freesurfer installs its own entire install of an older version of MINC > that will compete with your own MINC install. You will have to modify > your .bashrc or .cshrc so that your PATH variable puts the MINC path > first. > > Good luck. > > > a > > On 22 January 2011 08:25, Lisa F. Akiyama wrote: > >> > >> Hi Andrew, > >> > >> When I uninstalled Freesurfer and re-installed the newest > Ubuntu-Maverick > >> MINC package that you had just uploaded yesterday, > >> register worked just fine. > >> However, once I installed FreeSurfer again, the same errors appear and > when > >> I check the version of register, it is 1.3.5 now. > >> I'm suspecting that this is so because the register that comes with > >> FreeSurfer is an older version. > >> When I run register with the -rgb option, I only get a funky black&white > >> screen (please see attached). > >> Is there a way to have both FreeSurfer and MINC on my workstation, but > have > >> the new functions of MINC (such as this register command) be newer? > >> Shall I just remove/replace the MINC commands of Freesurfer? > >> > >> Thank you. > >> > >> > >> Best, > >> Lisa > >> > >> > >> P Please consider the environment before printing this e-mail. > >> > >> > >> > >> On Thu, Jan 20, 2011 at 7:59 PM, Andrew Janke > wrote: > >> > >>> > Apparently I am running register 1.3.5 (on Ubuntu 11.04). > >>> > I tried installing freeglut3, but I had it already. > >>> > >>> Good good. > >>> > >>> > Is the issue related to the older version of register? > >>> > >>> It might be. In later releases of register the rendering mode is set > >>> to RGB by default instead of indexed mode. > >>> > >>> If this is your problem, running it as such should help: > >>> > >>> $ register -rgb ... > >>> > >>> > >>> 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 francois.hebert007 at gmail.com Thu Jan 27 12:57:50 2011 From: francois.hebert007 at gmail.com (francois hebert) Date: Thu, 27 Jan 2011 12:57:50 -0500 Subject: [MINC-users] Computing vertices average distance Message-ID: Hi All, Is there a minc tool that compute the average distance between vertices? Thanks, Francois From mishkind at gmail.com Thu Jan 27 18:00:04 2011 From: mishkind at gmail.com (Mishkin Derakhshan) Date: Thu, 27 Jan 2011 18:00:04 -0500 Subject: [MINC-users] Computing vertices average distance In-Reply-To: References: Message-ID: Hi Francois, Can you give us some more detail? Do you have a single .obj file with n vertices and you want to know the average distance between all of them, or just the central point (com) of all the vertices? or, do you have n .obj files, each with m vertices and you want to know the average distance at a particular vertex, across all .obj files? You might want to look at average surfaces which will not give you a distance, but rather a new .obj file which will contain the location of the average vertex. Usage: average_surfaces output.obj none|rms_file none|variance_file n_groups [input1.obj] [input2.obj] ... I usually invoke as follows: average_surfaces average.obj none none 1 surf1.obj surf2.obj hth, mishkin From francois.hebert007 at gmail.com Fri Jan 28 10:05:56 2011 From: francois.hebert007 at gmail.com (francois hebert) Date: Fri, 28 Jan 2011 10:05:56 -0500 Subject: [MINC-users] Computing vertices average distance In-Reply-To: References: Message-ID: Hi Mishkin, What I want to know it's the average distance between all verties in one single .obj file. I'm working on the cortical thickness and I want to smooth the data using the diffuse minc tool the thing is that I would like to ahve an idea about the distances between the vertices to know the range of fwhm I should use. Thanks for the reply Francois 2011/1/27 Mishkin Derakhshan > Hi Francois, > > Can you give us some more detail? > > Do you have a single .obj file with n vertices and you want to know > the average distance between all of them, or just the central point > (com) of all the vertices? > or, do you have n .obj files, each with m vertices and you want to > know the average distance at a particular vertex, across all .obj > files? > > You might want to look at average surfaces which will not give you a > distance, but rather a new .obj file which will contain the location > of the average vertex. > > Usage: average_surfaces output.obj none|rms_file none|variance_file > n_groups > [input1.obj] [input2.obj] ... > > I usually invoke as follows: > average_surfaces average.obj none none 1 surf1.obj surf2.obj > > hth, > mishkin > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From francois.hebert007 at gmail.com Fri Jan 28 10:16:39 2011 From: francois.hebert007 at gmail.com (francois hebert) Date: Fri, 28 Jan 2011 10:16:39 -0500 Subject: [MINC-users] median filter Message-ID: Hi, I wuld like to know if there is a median filter in the minc tool or if somebody have it? I know that we can specified kernel with mincmoprh but i'm not sure I can use mincmorph to perform the median filtering. Thanks, Francois From vladimir.fonov at gmail.com Fri Jan 28 11:34:47 2011 From: vladimir.fonov at gmail.com (Vladimir FONOV) Date: Fri, 28 Jan 2011 11:34:47 -0500 Subject: [MINC-users] median filter In-Reply-To: References: Message-ID: <4D42F027.4030404@gmail.com> Hello, I use morphology filters from ITK, using ezminc to interface it with MINC: http://en.wikibooks.org/wiki/MINC/EZMINC francois hebert wrote: > I wuld like to know if there is a median filter in the minc tool or if > somebody have it? > I know that we can specified kernel with mincmoprh but i'm not sure I can > use mincmorph to perform the median filtering. -- Best regards, Vladimir S. FONOV ~ v.s.fonov ilmarin.info From francois.hebert007 at gmail.com Fri Jan 28 11:46:14 2011 From: francois.hebert007 at gmail.com (francois hebert) Date: Fri, 28 Jan 2011 11:46:14 -0500 Subject: [MINC-users] median filter In-Reply-To: <4D42F027.4030404@gmail.com> References: <4D42F027.4030404@gmail.com> Message-ID: Hello Vladimir, Thanks for the tip I will have a look on it. Francois 2011/1/28 Vladimir FONOV > Hello, > > > I use morphology filters from ITK, using ezminc to interface it with MINC: > > http://en.wikibooks.org/wiki/MINC/EZMINC > > > > francois hebert wrote: > >> I wuld like to know if there is a median filter in the minc tool or if >> somebody have it? >> I know that we can specified kernel with mincmoprh but i'm not sure I can >> use mincmorph to perform the median filtering. >> > > > -- > Best regards, > Vladimir S. FONOV ~ v.s.fonov ilmarin.info > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From louis.collins at mcgill.ca Fri Jan 28 11:52:33 2011 From: louis.collins at mcgill.ca (D. Louis Collins) Date: Fri, 28 Jan 2011 11:52:33 -0500 Subject: [MINC-users] The future of MINC -> I have some $$ to help; coder(s) needed In-Reply-To: References: Message-ID: Hi all, I agree with much of what Pierre described below and I would like to help push MINC forward. In addition to the points raised by PIerre, I think we need additional documentation + examples (both for coders and users, but more for users). I still have questions about NIFTI support, but I'm willing to be convinced... I have some money available and would be willing to apply it to consulting salary to address some of the problems raised in terms of distribution and installation issues, documentation, . I have one constraint - the money needs to be spent before the summer. At the same time, this is an advantage - we could move forward towards solving some of the issues quickly. So, are there people out there that would be willing to trade time for cash? If you are interested or know who is interested, please get in touch with me directly. Feel free to forward this message. best regards, -Louis ps - please note that there will be a discussion of minc development on the geeks user list D. Louis Collins, PhD McConnell Brain Imaging Center Associate Professor Montreal Neurological Institute Neurology & Neurosurgery WB-314 Biomedical Engineering 3801 University St. louis.collins at mcgill.ca Montreal, Quebec. voice: (514)-398-4227/8554 CANADA H3A 2B4 Fax: (514)-398-2975 http://www.bic.mni.mcgill.ca/PeopleFaculty/CollinsDLouis On Dec 16, 2010, at 12:06 PM, Pierre Bellec wrote: > Dear MINC fellow users and developers, > > I am writing to you regarding a number of issues that I think are pressing regarding the future of MINC. I have been using the minc tools and the minc format for a while, and it has helped me tremendously in my work over the past couple of years. I am grateful to the community that develop this software, and it is because I like MINC so much that I am worried about what I see as major challenges : > > 1. Distribution > > Basically, outside of debian/ubuntu, it is often very difficult or impossible to install the MINC tools for simple end users. Even on debian/ubuntu, with the current level of testing for released packages some minor issues remain. Also, there are well over 10 packages to install to get the full MINC suite. This is confusing for end-users, to say the least. Andrew has made a great job at simplifying all that. He notably made a bundle for ubuntu that comes with all the tools at once and is a life saver. But Andrew alone can't support all platforms and do all the testing. One way around that would be to have a number of sites/individuals committing to release OR test tar balls/packages for a given platform. I believe that something could be arranged to build a TAR ball at CRIUGM for MAC OS 10.6 for example. I can certainly commit to make tests for all releases of the bundle on a fresh Ubuntu system before release. We would need a tutorial to build a complete MINC bundle with static libraries such that end users can just download, run an installation script/install package, and have the full MINC suite up and working. > > 2. I/O > > The libraries to manipulate MINC in C are a bit difficult to use. And there are no tools easy to install to manipulate MINC in the major data analysis languages, say R, Python, Octave & Matlab. There are efforts in these directions : I am myself working on something for Matlab/Octave to replace EMMA, I know that Vlad has an alternative C library (EZminc), Jason/Jim have developed I/O libraries in R and there are efforts towards MINC integration in NiPy. Those efforts are important but may not be sufficient. I am going to break a taboo, but I believe that to reach a wider audience, it is mandatory that MINC tools work with NIFTI. Whether we like it or not, NIFTI is by far the most widely used format currently. Confining MINC tools to the MINC format is I think a mistake. That would involve redesigning the I/O C library to make use of MINC or NIFTI transparent for the coder. I have developed something like that in NIAK, and it works well. > > 3. Community of developers > > Current changes made to MINC are essentially maintenance rather than integration of new methods. There are actually new methods being developed, but they don't necessarily make it to the CVS repository (e.g. ITK-SNAP, ELASTIX). There is currently no roadmap for the future. How can we be aware of current initiatives such that we can give feedback / participate ? How do we prioritize areas of developments ? What new developments should be included in the MINC bundle and which ones should not ? The developer mailing list is not super active. There has not been a workshop for years. There are no mechanisms like in google code or (better) track to define milestones, open tickets, prioritize, assign tasks, review commits etc. Students are not encouraged to commit changes and new tools. Developing for the MINC tools may simply not be attractive enough, notably because of issues 1&2 above. > > Those 3 points are closely related, because as long as MINC is not easy to install and interface with new code (points 1/2), it will not attract users/developers. If the package does not include new method, it will die. I still believe MINC has the potential to remain one of the best available image analysis libraries around for the years to come, but it needs an electroshock. Dedicated resources (like one full-time maintainer/developer) would help a lot, but I believe the points 1-3 can be addressed by the community as it is today with proper organization and enthusiasm. > > I am curious to hear what you guys think about all that. Best regards, > > Pierre Bellec, PhD > Chercheur adjoint > Centre de recherche de l'institut de G?riatrie de Montr?al > D?partement d'informatique et de recherche op?rationnelle > Universit? de Montr?al > http://simexp-lab.org/brainwiki/doku.php?id=pierrebellec > (001)(514) 340 3540 #3367 > > From vladimir.fonov at gmail.com Fri Jan 28 11:57:37 2011 From: vladimir.fonov at gmail.com (Vladimir FONOV) Date: Fri, 28 Jan 2011 11:57:37 -0500 Subject: [MINC-users] median filter In-Reply-To: References: <4D42F027.4030404@gmail.com> Message-ID: <4D42F581.1080003@gmail.com> Hello, see attached file for my grayscale morphology program. francois hebert wrote: > Thanks for the tip I will have a look on it. > > Francois > > 2011/1/28 Vladimir FONOV > >> Hello, >> >> >> I use morphology filters from ITK, using ezminc to interface it with MINC: >> >> http://en.wikibooks.org/wiki/MINC/EZMINC >> >> >> >> francois hebert wrote: >> >>> I wuld like to know if there is a median filter in the minc tool or if >>> somebody have it? >>> I know that we can specified kernel with mincmoprh but i'm not sure I can >>> use mincmorph to perform the median filtering. -- Best regards, Vladimir S. FONOV ~ v.s.fonov ilmarin.info From francois.hebert007 at gmail.com Fri Jan 28 12:06:10 2011 From: francois.hebert007 at gmail.com (francois hebert) Date: Fri, 28 Jan 2011 12:06:10 -0500 Subject: [MINC-users] median filter In-Reply-To: <4D42F581.1080003@gmail.com> References: <4D42F027.4030404@gmail.com> <4D42F581.1080003@gmail.com> Message-ID: Hello, Not sure but I think you forgot to attach the file. 2011/1/28 Vladimir FONOV > Hello, > > see attached file for my grayscale morphology program. > > > francois hebert wrote: > >> Thanks for the tip I will have a look on it. >> >> Francois >> >> 2011/1/28 Vladimir FONOV >> >> Hello, >>> >>> >>> I use morphology filters from ITK, using ezminc to interface it with >>> MINC: >>> >>> http://en.wikibooks.org/wiki/MINC/EZMINC >>> >>> >>> >>> francois hebert wrote: >>> >>> I wuld like to know if there is a median filter in the minc tool or if >>>> somebody have it? >>>> I know that we can specified kernel with mincmoprh but i'm not sure I >>>> can >>>> use mincmorph to perform the median filtering. >>>> >>> > > -- > Best regards, > Vladimir S. FONOV ~ v.s.fonov ilmarin.info > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > From vladimir.fonov at gmail.com Fri Jan 28 12:15:55 2011 From: vladimir.fonov at gmail.com (Vladimir S. FONOV) Date: Fri, 28 Jan 2011 12:15:55 -0500 Subject: [MINC-users] median filter In-Reply-To: References: <4D42F027.4030404@gmail.com> <4D42F581.1080003@gmail.com> Message-ID: <4D42F9CB.2010203@gmail.com> Hello, looks like mailing list removes attachments. Here it is: http://www.bic.mni.mcgill.ca/~vfonov/software/itk_g_morph.cpp francois hebert wrote: > Hello, > > Not sure but I think you forgot to attach the file. > > 2011/1/28 Vladimir FONOV > >> Hello, >> >> see attached file for my grayscale morphology program. >> >> >> francois hebert wrote: >> >>> Thanks for the tip I will have a look on it. >>> >>> Francois >>> >>> 2011/1/28 Vladimir FONOV >>> >>> Hello, >>>> >>>> I use morphology filters from ITK, using ezminc to interface it with >>>> MINC: >>>> >>>> http://en.wikibooks.org/wiki/MINC/EZMINC >>>> >>>> >>>> >>>> francois hebert wrote: >>>> >>>> I wuld like to know if there is a median filter in the minc tool or if >>>>> somebody have it? >>>>> I know that we can specified kernel with mincmoprh but i'm not sure I >>>>> can >>>>> use mincmorph to perform the median filtering. >>>>> >> -- >> Best regards, >> Vladimir S. FONOV ~ v.s.fonov ilmarin.info >> >> _______________________________________________ >> 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 -- Best regards, Vladimir S. FONOV ~ v.s.fonov ilmarin.info From francois.hebert007 at gmail.com Fri Jan 28 12:28:26 2011 From: francois.hebert007 at gmail.com (francois hebert) Date: Fri, 28 Jan 2011 12:28:26 -0500 Subject: [MINC-users] median filter In-Reply-To: <4D42F9CB.2010203@gmail.com> References: <4D42F027.4030404@gmail.com> <4D42F581.1080003@gmail.com> <4D42F9CB.2010203@gmail.com> Message-ID: Thanks a lot. Francois 2011/1/28 Vladimir S. FONOV > Hello, > > looks like mailing list removes attachments. Here it is: > http://www.bic.mni.mcgill.ca/~vfonov/software/itk_g_morph.cpp > > > francois hebert wrote: > >> Hello, >> >> Not sure but I think you forgot to attach the file. >> >> 2011/1/28 Vladimir FONOV >> >> Hello, >>> >>> see attached file for my grayscale morphology program. >>> >>> >>> francois hebert wrote: >>> >>> Thanks for the tip I will have a look on it. >>>> >>>> Francois >>>> >>>> 2011/1/28 Vladimir FONOV >>>> >>>> Hello, >>>> >>>>> >>>>> I use morphology filters from ITK, using ezminc to interface it with >>>>> MINC: >>>>> >>>>> http://en.wikibooks.org/wiki/MINC/EZMINC >>>>> >>>>> >>>>> >>>>> francois hebert wrote: >>>>> >>>>> I wuld like to know if there is a median filter in the minc tool or if >>>>> >>>>>> somebody have it? >>>>>> I know that we can specified kernel with mincmoprh but i'm not sure I >>>>>> can >>>>>> use mincmorph to perform the median filtering. >>>>>> >>>>>> -- >>> Best regards, >>> Vladimir S. FONOV ~ v.s.fonov ilmarin.info >>> >>> _______________________________________________ >>> 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 >> > > > -- > Best regards, > Vladimir S. FONOV ~ v.s.fonov ilmarin.info > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From mishkind at gmail.com Fri Jan 28 14:09:47 2011 From: mishkind at gmail.com (Mishkin Derakhshan) Date: Fri, 28 Jan 2011 14:09:47 -0500 Subject: [MINC-users] median filter In-Reply-To: References: <4D42F027.4030404@gmail.com> <4D42F581.1080003@gmail.com> <4D42F9CB.2010203@gmail.com> Message-ID: Alternatively, here is a perl script that does the filtering on the histogram of the data, and not the data itself. #! /usr/bin/perl my $default = 5; if (scalar(@ARGV) < 1) { usage(1); exit(1); } my $cnt=0; my ($i, $j, $p); my @pts; my @arr; my @bins; my $median_samples=$ARGV[1]; if(!defined($median_samples)){ $median_sample=$default; print "Using default window size of: $default\n"; } open(FIN,"$ARGV[0]"); while(){ $i=""; chomp; ($j, $i, $p)=split(/ +/,$_); # print "[$j] [$i] [$p]\n"; if($j !~ m/\#/){ if("$i" ne ""){ push @pts, $p; push @bins, $i; $cnt++; } } } my $hmedian= int($median_samples/2); for ($i=0; $i<=$cnt-$median_samples; $i++){ my @arr; for ($j=0; $j<=$median_samples; $j++){ $arr[$j]= $pts[$i+$j] } my @sorted= sort {$a <=> $b} @arr; push @filtered, $sorted[$hmedian]; } for ($i=0; $i< $hmedian; $i++){ unshift @filtered, $filtered[0]; push @filtered, $filtered[$#filtered]; } # print map "$_\n", @filtered; for ($i=0; $i< $cnt; $i++){ print " $bins[$i] $filtered[$i]\n"; } sub usage{ @params = @_; @array = split(/\//,$0); $me = $array[$#array]; if($params[0]==1){ print "\nDoes a median filter on histogram data. The input file is the output from mincstats\n"; #print "\tOptions:\n"; print "\n[window_size] is the number of bins to include when calculating the median (default: ${default})\n"; print "\n"; } print "\nUsage:"; print "\t$me [window_size]\n"; #print "\t$me -help\n"; } On Fri, Jan 28, 2011 at 12:28 PM, francois hebert wrote: > Thanks a lot. > > Francois > > 2011/1/28 Vladimir S. FONOV > >> Hello, >> >> looks like mailing list removes attachments. Here it is: >> http://www.bic.mni.mcgill.ca/~vfonov/software/itk_g_morph.cpp >> >> >> francois hebert wrote: >> >>> Hello, >>> >>> Not sure but I think you forgot to attach the file. >>> >>> 2011/1/28 Vladimir FONOV >>> >>> ?Hello, >>>> >>>> see attached file for my grayscale morphology program. >>>> >>>> >>>> francois hebert wrote: >>>> >>>> ?Thanks for the tip I will have a look on it. >>>>> >>>>> Francois >>>>> >>>>> 2011/1/28 Vladimir FONOV >>>>> >>>>> ?Hello, >>>>> >>>>>> >>>>>> I use morphology filters from ITK, using ezminc to interface it with >>>>>> MINC: >>>>>> >>>>>> http://en.wikibooks.org/wiki/MINC/EZMINC >>>>>> >>>>>> >>>>>> >>>>>> francois hebert wrote: >>>>>> >>>>>> ?I wuld like to know if there is a median filter in the minc tool or if >>>>>> >>>>>>> somebody have it? >>>>>>> I know that we can specified kernel with mincmoprh but i'm not sure I >>>>>>> can >>>>>>> use mincmorph to perform the median filtering. >>>>>>> >>>>>>> ?-- >>>> Best regards, >>>> ?Vladimir S. FONOV ~ v.s.fonov ? ilmarin.info >>>> >>>> _______________________________________________ >>>> 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 >>> >> >> >> -- >> Best regards, >> ?Vladimir S. FONOV ~ v.s.fonov ? ilmarin.info >> _______________________________________________ >> 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 vladimir.fonov at gmail.com Fri Jan 28 14:16:11 2011 From: vladimir.fonov at gmail.com (Vladimir S. FONOV) Date: Fri, 28 Jan 2011 14:16:11 -0500 Subject: [MINC-users] median filter In-Reply-To: References: <4D42F027.4030404@gmail.com> <4D42F581.1080003@gmail.com> <4D42F9CB.2010203@gmail.com> Message-ID: <4D4315FB.7090504@gmail.com> Hello, why not to use mincstat -pctT 50 for this ? Mishkin Derakhshan wrote: > Alternatively, here is a perl script that does the filtering on the > histogram of the data, and not the data itself. > > > #! /usr/bin/perl > > my $default = 5; > if (scalar(@ARGV) < 1) { > usage(1); > exit(1); > } > > > my $cnt=0; > my ($i, $j, $p); > my @pts; > my @arr; > my @bins; > my $median_samples=$ARGV[1]; > > > if(!defined($median_samples)){ > $median_sample=$default; > print "Using default window size of: $default\n"; > } > > open(FIN,"$ARGV[0]"); > while(){ > $i=""; > chomp; > ($j, $i, $p)=split(/ +/,$_); > # print "[$j] [$i] [$p]\n"; > if($j !~ m/\#/){ > if("$i" ne ""){ > push @pts, $p; > push @bins, $i; > $cnt++; > } > } > } > > my $hmedian= int($median_samples/2); > for ($i=0; $i<=$cnt-$median_samples; $i++){ > my @arr; > for ($j=0; $j<=$median_samples; $j++){ > $arr[$j]= $pts[$i+$j] > } > my @sorted= sort {$a <=> $b} @arr; > push @filtered, $sorted[$hmedian]; > } > > for ($i=0; $i< $hmedian; $i++){ > unshift @filtered, $filtered[0]; > push @filtered, $filtered[$#filtered]; > } > > # print map "$_\n", @filtered; > for ($i=0; $i< $cnt; $i++){ > print " $bins[$i] $filtered[$i]\n"; > } > > sub usage{ > @params = @_; > @array = split(/\//,$0); > $me = $array[$#array]; > if($params[0]==1){ > print "\nDoes a median filter on histogram data. The input > file is the output from mincstats\n"; > #print "\tOptions:\n"; > print "\n[window_size] is the number of bins to include when > calculating the median (default: ${default})\n"; > print "\n"; > } > print "\nUsage:"; > print "\t$me [window_size]\n"; > #print "\t$me -help\n"; > } > > > On Fri, Jan 28, 2011 at 12:28 PM, francois hebert > wrote: >> Thanks a lot. >> >> Francois >> >> 2011/1/28 Vladimir S. FONOV >> >>> Hello, >>> >>> looks like mailing list removes attachments. Here it is: >>> http://www.bic.mni.mcgill.ca/~vfonov/software/itk_g_morph.cpp >>> >>> >>> francois hebert wrote: >>> >>>> Hello, >>>> >>>> Not sure but I think you forgot to attach the file. >>>> >>>> 2011/1/28 Vladimir FONOV >>>> >>>> Hello, >>>>> see attached file for my grayscale morphology program. >>>>> >>>>> >>>>> francois hebert wrote: >>>>> >>>>> Thanks for the tip I will have a look on it. >>>>>> Francois >>>>>> >>>>>> 2011/1/28 Vladimir FONOV >>>>>> >>>>>> Hello, >>>>>> >>>>>>> I use morphology filters from ITK, using ezminc to interface it with >>>>>>> MINC: >>>>>>> >>>>>>> http://en.wikibooks.org/wiki/MINC/EZMINC >>>>>>> >>>>>>> >>>>>>> >>>>>>> francois hebert wrote: >>>>>>> >>>>>>> I wuld like to know if there is a median filter in the minc tool or if >>>>>>> >>>>>>>> somebody have it? >>>>>>>> I know that we can specified kernel with mincmoprh but i'm not sure I >>>>>>>> can >>>>>>>> use mincmorph to perform the median filtering. >>>>>>>> >>>>>>>> -- >>>>> Best regards, >>>>> Vladimir S. FONOV ~ v.s.fonov ilmarin.info >>>>> >>>>> _______________________________________________ >>>>> 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 >>>> >>> >>> -- >>> Best regards, >>> Vladimir S. FONOV ~ v.s.fonov ilmarin.info >>> _______________________________________________ >>> 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 -- Best regards, Vladimir S. FONOV ~ v.s.fonov ilmarin.info From francois.hebert007 at gmail.com Fri Jan 28 14:41:09 2011 From: francois.hebert007 at gmail.com (francois hebert) Date: Fri, 28 Jan 2011 14:41:09 -0500 Subject: [MINC-users] median filter In-Reply-To: References: <4D42F027.4030404@gmail.com> <4D42F581.1080003@gmail.com> <4D42F9CB.2010203@gmail.com> Message-ID: Hello Mishkin, I want to filter the data not the histogram of the data. Maybe I miss something... I thank you for the script. 2011/1/28 Mishkin Derakhshan > Alternatively, here is a perl script that does the filtering on the > histogram of the data, and not the data itself. > > > #! /usr/bin/perl > > my $default = 5; > if (scalar(@ARGV) < 1) { > usage(1); > exit(1); > } > > > my $cnt=0; > my ($i, $j, $p); > my @pts; > my @arr; > my @bins; > my $median_samples=$ARGV[1]; > > > if(!defined($median_samples)){ > $median_sample=$default; > print "Using default window size of: $default\n"; > } > > open(FIN,"$ARGV[0]"); > while(){ > $i=""; > chomp; > ($j, $i, $p)=split(/ +/,$_); > # print "[$j] [$i] [$p]\n"; > if($j !~ m/\#/){ > if("$i" ne ""){ > push @pts, $p; > push @bins, $i; > $cnt++; > } > } > } > > my $hmedian= int($median_samples/2); > for ($i=0; $i<=$cnt-$median_samples; $i++){ > my @arr; > for ($j=0; $j<=$median_samples; $j++){ > $arr[$j]= $pts[$i+$j] > } > my @sorted= sort {$a <=> $b} @arr; > push @filtered, $sorted[$hmedian]; > } > > for ($i=0; $i< $hmedian; $i++){ > unshift @filtered, $filtered[0]; > push @filtered, $filtered[$#filtered]; > } > > # print map "$_\n", @filtered; > for ($i=0; $i< $cnt; $i++){ > print " $bins[$i] $filtered[$i]\n"; > } > > sub usage{ > @params = @_; > @array = split(/\//,$0); > $me = $array[$#array]; > if($params[0]==1){ > print "\nDoes a median filter on histogram data. The input > file is the output from mincstats\n"; > #print "\tOptions:\n"; > print "\n[window_size] is the number of bins to include when > calculating the median (default: ${default})\n"; > print "\n"; > } > print "\nUsage:"; > print "\t$me [window_size]\n"; > #print "\t$me -help\n"; > } > > > On Fri, Jan 28, 2011 at 12:28 PM, francois hebert > wrote: > > Thanks a lot. > > > > Francois > > > > 2011/1/28 Vladimir S. FONOV > > > >> Hello, > >> > >> looks like mailing list removes attachments. Here it is: > >> http://www.bic.mni.mcgill.ca/~vfonov/software/itk_g_morph.cpp > > >> > >> > >> francois hebert wrote: > >> > >>> Hello, > >>> > >>> Not sure but I think you forgot to attach the file. > >>> > >>> 2011/1/28 Vladimir FONOV > >>> > >>> Hello, > >>>> > >>>> see attached file for my grayscale morphology program. > >>>> > >>>> > >>>> francois hebert wrote: > >>>> > >>>> Thanks for the tip I will have a look on it. > >>>>> > >>>>> Francois > >>>>> > >>>>> 2011/1/28 Vladimir FONOV > >>>>> > >>>>> Hello, > >>>>> > >>>>>> > >>>>>> I use morphology filters from ITK, using ezminc to interface it with > >>>>>> MINC: > >>>>>> > >>>>>> http://en.wikibooks.org/wiki/MINC/EZMINC > >>>>>> > >>>>>> > >>>>>> > >>>>>> francois hebert wrote: > >>>>>> > >>>>>> I wuld like to know if there is a median filter in the minc tool or > if > >>>>>> > >>>>>>> somebody have it? > >>>>>>> I know that we can specified kernel with mincmoprh but i'm not sure > I > >>>>>>> can > >>>>>>> use mincmorph to perform the median filtering. > >>>>>>> > >>>>>>> -- > >>>> Best regards, > >>>> Vladimir S. FONOV ~ v.s.fonov ilmarin.info > >>>> > >>>> _______________________________________________ > >>>> 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 > >>> > >> > >> > >> -- > >> Best regards, > >> Vladimir S. FONOV ~ v.s.fonov ilmarin.info > >> _______________________________________________ > >> 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 Jan 28 14:44:04 2011 From: francois.hebert007 at gmail.com (francois hebert) Date: Fri, 28 Jan 2011 14:44:04 -0500 Subject: [MINC-users] median filter In-Reply-To: <4D4315FB.7090504@gmail.com> References: <4D42F027.4030404@gmail.com> <4D42F581.1080003@gmail.com> <4D42F9CB.2010203@gmail.com> <4D4315FB.7090504@gmail.com> Message-ID: Hello, I want to filter the data if I use mincstats I will ahve a global effect on the images no? Francois 2011/1/28 Vladimir S. FONOV > Hello, > > > why not to use mincstat -pctT 50 for this ? > > > Mishkin Derakhshan wrote: > >> Alternatively, here is a perl script that does the filtering on the >> histogram of the data, and not the data itself. >> >> >> #! /usr/bin/perl >> >> my $default = 5; >> if (scalar(@ARGV) < 1) { >> usage(1); >> exit(1); >> } >> >> >> my $cnt=0; >> my ($i, $j, $p); >> my @pts; >> my @arr; >> my @bins; >> my $median_samples=$ARGV[1]; >> >> >> if(!defined($median_samples)){ >> $median_sample=$default; >> print "Using default window size of: $default\n"; >> } >> >> open(FIN,"$ARGV[0]"); >> while(){ >> $i=""; >> chomp; >> ($j, $i, $p)=split(/ +/,$_); >> # print "[$j] [$i] [$p]\n"; >> if($j !~ m/\#/){ >> if("$i" ne ""){ >> push @pts, $p; >> push @bins, $i; >> $cnt++; >> } >> } >> } >> >> my $hmedian= int($median_samples/2); >> for ($i=0; $i<=$cnt-$median_samples; $i++){ >> my @arr; >> for ($j=0; $j<=$median_samples; $j++){ >> $arr[$j]= $pts[$i+$j] >> } >> my @sorted= sort {$a <=> $b} @arr; >> push @filtered, $sorted[$hmedian]; >> } >> >> for ($i=0; $i< $hmedian; $i++){ >> unshift @filtered, $filtered[0]; >> push @filtered, $filtered[$#filtered]; >> } >> >> # print map "$_\n", @filtered; >> for ($i=0; $i< $cnt; $i++){ >> print " $bins[$i] $filtered[$i]\n"; >> } >> >> sub usage{ >> @params = @_; >> @array = split(/\//,$0); >> $me = $array[$#array]; >> if($params[0]==1){ >> print "\nDoes a median filter on histogram data. The input >> file is the output from mincstats\n"; >> #print "\tOptions:\n"; >> print "\n[window_size] is the number of bins to include when >> calculating the median (default: ${default})\n"; >> print "\n"; >> } >> print "\nUsage:"; >> print "\t$me [window_size]\n"; >> #print "\t$me -help\n"; >> } >> >> >> On Fri, Jan 28, 2011 at 12:28 PM, francois hebert >> wrote: >> >>> Thanks a lot. >>> >>> Francois >>> >>> 2011/1/28 Vladimir S. FONOV >>> >>> Hello, >>>> >>>> looks like mailing list removes attachments. Here it is: >>>> http://www.bic.mni.mcgill.ca/~vfonov/software/itk_g_morph.cpp >>>> >>>> >>>> >>>> francois hebert wrote: >>>> >>>> Hello, >>>>> >>>>> Not sure but I think you forgot to attach the file. >>>>> >>>>> 2011/1/28 Vladimir FONOV >>>>> >>>>> Hello, >>>>> >>>>>> see attached file for my grayscale morphology program. >>>>>> >>>>>> >>>>>> francois hebert wrote: >>>>>> >>>>>> Thanks for the tip I will have a look on it. >>>>>> >>>>>>> Francois >>>>>>> >>>>>>> 2011/1/28 Vladimir FONOV >>>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> I use morphology filters from ITK, using ezminc to interface it with >>>>>>>> MINC: >>>>>>>> >>>>>>>> http://en.wikibooks.org/wiki/MINC/EZMINC >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> francois hebert wrote: >>>>>>>> >>>>>>>> I wuld like to know if there is a median filter in the minc tool or >>>>>>>> if >>>>>>>> >>>>>>>> somebody have it? >>>>>>>>> I know that we can specified kernel with mincmoprh but i'm not sure >>>>>>>>> I >>>>>>>>> can >>>>>>>>> use mincmorph to perform the median filtering. >>>>>>>>> >>>>>>>>> -- >>>>>>>>> >>>>>>>> Best regards, >>>>>> Vladimir S. FONOV ~ v.s.fonov ilmarin.info >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >>>>> >>>>> >>>> -- >>>> Best regards, >>>> Vladimir S. FONOV ~ v.s.fonov ilmarin.info >>>> _______________________________________________ >>>> 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 >> > > > -- > Best regards, > Vladimir S. FONOV ~ v.s.fonov ilmarin.info > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From a.janke at gmail.com Sun Jan 30 09:04:41 2011 From: a.janke at gmail.com (Andrew Janke) Date: Mon, 31 Jan 2011 00:04:41 +1000 Subject: [MINC-users] median filter In-Reply-To: References: Message-ID: Hi Francois, On 29 January 2011 01:16, francois hebert wrote: > I wuld like to know if there is a median filter in the minc tool or if > somebody have it? > I know that we can specified kernel with mincmoprh but i'm not sure I can > use mincmorph to perform the median filtering. I see a bunch of others have thrown all sorts of code at you already but I'd hate to be left out of this little game so here goes.. There is a median _dilate_ option in mincmorph (dilates by the median of the values in the structuring element) but from other replies I think you want to do a median filter on the whole volume? mincmorph certainly won't be the quickest option but ti will do it via a convolution kernel. If you want to do a simple 3x3 6-connected filtering (8 neighbours) I'd do this: First make a kernel file (file.kern): --- MNI Morphology Kernel File % % 3D 6-connectivity ie: (in 2D) % % 1 % 1 0 1 % 1 % % 0 - center voxel % Format: vector for voxel in 5 dimensions (x,y,z,t,v) then multiplier. Kernel_Type = Normal_Kernel; Kernel = % x y z t v coeff % ----------------------------------- 1.0 0.0 0.0 0.0 0.0 0.166666 -1.0 0.0 0.0 0.0 0.0 0.166666 0.0 1.0 0.0 0.0 0.0 0.166666 0.0 -1.0 0.0 0.0 0.0 0.166666 0.0 0.0 1.0 0.0 0.0 0.166666 0.0 0.0 -1.0 0.0 0.0 0.166666; ---- Then use it (note that for each of the 6 neighbors 1/6 of their value is added to the result). $ mincmorph -kernel file.kern input.mnc out.mnc At least it will work with sufficient speed to see if it works for you. As you go to larger elements/filters it will slow down. have fun. Andrew From stephencohen at jgh.mcgill.ca Sun Jan 30 10:02:58 2011 From: stephencohen at jgh.mcgill.ca (stephencohen at jgh.mcgill.ca) Date: Sun, 30 Jan 2011 10:02:58 -0500 Subject: [MINC-users] AUTO: Stephen Cohen is out of the office (vacation) (returning 2011-02-25) Message-ID: I am out of the office until 2011-02-25. Thank you for your email. I will be out of the office with no access to email until Thursday February 24th 2011. For IT matters you may contact Chris Polykandriotis at cpolykan at jgh.mcgill.ca and ext. 2629. Thank you! Note: This is an automated response to your message "Re: [MINC-users] median filter" sent on 1/30/2011 9:04:41 AM. This is the only notification you will receive while this person is away. From a.janke at gmail.com Sun Jan 30 11:28:53 2011 From: a.janke at gmail.com (Andrew Janke) Date: Mon, 31 Jan 2011 02:28:53 +1000 Subject: [MINC-users] The future of MINC Message-ID: Hi Pierre, Sorry I never saw the original email but here goes... > On Dec 16, 2010, at 12:06 PM, Pierre Bellec wrote: > >> 1. Distribution >> Basically, outside of debian/ubuntu, it is often very difficult or impossible to install the MINC tools for simple end users. Agree. There are some reasons for this to do with licensing of differing packages but yes it could be very much simplified. The catalyst for this might be shifting the MINC CVS repository to somewhere that is more conducive to external developers. (NITRC/Google Code/Launchpad/etc). > could be arranged to build a TAR ball at CRIUGM for MAC OS 10.6 for example. Sounds good to me. You mean a big .mpkg for everything? MINC has always been something that if you build it, we/I will link to it. >> 2. I/O >> The libraries to manipulate MINC in C are a bit difficult to use. I'd say necessarily difficult. Perhaps use /usr/local/bic/include/minc_simple.h for quick and dirty projects? I suspect that in time people will more use things like Jason's nipy interface. > I am going to break a taboo, but I believe that to reach a wider audience, it is mandatory that MINC tools work with NIFTI. Whether we like it or not, NIFTI is by far the most widely used format currently. Trust me, you are not the first to suggest this... I too have had thoughts of doing this but a few things always stop me before I go too far. The main concern is that while you can read NIFTI in one case it doesn't mean you can read them all (consistently). The stand out problem being of course "radio" vs "neurological" format files. Despite that problem that saving files flipped vs unflipped is somewhat daft (change the viewer not the data), the main issue is that you don't know from looking at the file itself. That and as soon as you read another format the assumption is that the conversion is perfect (and in both directions). I myself HIGHLY value that I always know that the orientation and world positioning of my files is 100% bang on. (Thanks Peter Neelin! :) For that I am prepared to run nii2mnc and mnc2nii from time to time. Still, I am not going to stop you... :) > Confining MINC tools to the MINC format is I think a mistake. You might be surprised to know that MINC (well volume_io) can indeed read another format called "free format". See start_volume_input() in minc/volume_io/Volumes/input_volume.c Adding a NIFTI format to the list and adding another case statement would not be hard. I'd just caution about writing it out again. Perhaps just a dodgy system call to nii2mnc and a tmpfile? Andrew From zijdenbos at gmail.com Mon Jan 31 21:54:54 2011 From: zijdenbos at gmail.com (Alex Zijdenbos) Date: Mon, 31 Jan 2011 21:54:54 -0500 Subject: [MINC-users] median filter In-Reply-To: References: Message-ID: Hi Andrew, I'm a bit puzzled by your suggestion - the mincmorph kernel you describe is a mean filter, not a median filter, right? AFAIK you can't implement a median filter by convolution (because you need to sort). That said, it still seems that mincmorph would be the most natural place for adding a median filter; it seems like all the ingredients are there. It seems like it would only be a minor modification of the median dilate option it already provides? -- A On Sun, Jan 30, 2011 at 9:04 AM, Andrew Janke wrote: > Hi Francois, > > On 29 January 2011 01:16, francois hebert wrote: >> I wuld like to know if there is a median filter in the minc tool or if >> somebody have it? >> I know that we can specified kernel with mincmoprh but i'm not sure I can >> use mincmorph to perform the median filtering. > > I see a bunch of others have thrown all sorts of code at you already > but I'd hate to be left out of this little game so here goes.. > > There is a median _dilate_ option in mincmorph (dilates by the median > of the values in the structuring element) but from other replies I > think you want to do a median filter on the whole volume? > > mincmorph certainly won't be the quickest option but ti will do it via > a convolution kernel. If you want to do a simple 3x3 6-connected > filtering (8 neighbours) I'd do this: > > First make a kernel file (file.kern): > > --- > MNI Morphology Kernel File > % > % 3D 6-connectivity ie: (in 2D) > % > % ? ? 1 > % ? 1 0 1 > % ? ? 1 > % > % 0 - center voxel > % Format: ?vector for voxel in 5 dimensions (x,y,z,t,v) then multiplier. > > Kernel_Type = Normal_Kernel; > Kernel = > % ? ?x ? ?y ? ?z ? ?t ? ?v ? ? coeff > % ----------------------------------- > ? 1.0 ?0.0 ?0.0 ?0.0 ?0.0 ? ? 0.166666 > ?-1.0 ?0.0 ?0.0 ?0.0 ?0.0 ? ? 0.166666 > ? 0.0 ?1.0 ?0.0 ?0.0 ?0.0 ? ? 0.166666 > ? 0.0 -1.0 ?0.0 ?0.0 ?0.0 ? ? 0.166666 > ? 0.0 ?0.0 ?1.0 ?0.0 ?0.0 ? ? 0.166666 > ? 0.0 ?0.0 -1.0 ?0.0 ?0.0 ? ? 0.166666; > ---- > > Then use it (note that for each of the 6 neighbors 1/6 of their value > is added to the result). > > ? $ mincmorph -kernel file.kern input.mnc out.mnc > > At least it will work with sufficient speed to see if it works for > you. ?As you go to larger elements/filters it will slow down. > > have fun. > > > > Andrew > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > From a.janke at gmail.com Mon Jan 31 22:19:05 2011 From: a.janke at gmail.com (Andrew Janke) Date: Tue, 1 Feb 2011 13:19:05 +1000 Subject: [MINC-users] median filter In-Reply-To: References: Message-ID: > I'm a bit puzzled by your suggestion - the mincmorph kernel you > describe is a mean filter, not a median filter, right? AFAIK you can't > implement a median filter by convolution (because you need to sort). Correct, I was more attempting to point out that it wouldn't be at all hard to modify the convolution kernel to do the median bit. When I re-read what I sent though seems I got a bit carried away. So yes, my bad what I described is a mean filter not median. > That said, it still seems that mincmorph would be the most natural > place for adding a median filter; it seems like all the ingredients > are there. It seems like it would only be a minor modification of the > median dilate option it already provides? Correct. a From pbellec at bic.mni.mcgill.ca Mon Jan 31 23:16:19 2011 From: pbellec at bic.mni.mcgill.ca (Pierre Bellec) Date: Mon, 31 Jan 2011 23:16:19 -0500 Subject: [MINC-users] The future of MINC In-Reply-To: References: Message-ID: Dear all, My apologies for being so late following up on this thread. First I would like to thank everyone who sent feedback, either directly to me or through the list, which has been quite reinvigorating. The main conclusion I drew from these emails is that there is much to do and lots of MINC fans out there, that we need to discuss about what the main priorities are and find resources to implement them quickly. I am very happy to see that Louis has taken the lead on these points, and I am looking forward to the upcoming round of discussions. But because good things can't wait, I have merged below my responses to the detailed emails that Andrew and Jason have sent. @Andrew >> Basically, outside of debian/ubuntu, it is often very difficult or > impossible to install the MINC tools for simple end users. > > Agree. There are some reasons for this to do with licensing of > differing packages but yes it could be very much simplified. The > catalyst for this might be shifting the MINC CVS repository to > somewhere that is more conducive to external developers. (NITRC/Google > Code/Launchpad/etc). > > I couldn't agree more. Having a proper development environment would certainly help making a leap forward in terms of external contributions and cleaning up the installation procedure. > could be arranged to build a TAR ball at CRIUGM for MAC OS 10.6 for > example. > > Sounds good to me. You mean a big .mpkg for everything? MINC has > always been something that if you build it, we/I will link to it. > > Maybe not a package per say, at this stage I was more thinking about a big .tar.gz with a full minc bundle in it. There have been some discussions going on to see if some of the resources of the Qu?bec bio-imaging network could be used to prepare this kind of archive. Nothing conclusive yet but I have good hope. > >> 2. I/O > >> The libraries to manipulate MINC in C are a bit difficult to use. > > I'd say necessarily difficult. Perhaps use > /usr/local/bic/include/minc_simple.h for quick and dirty projects? I > suspect that in time people will more use things like Jason's nipy > interface. > > An interface to high-level languages like python are certainly going to make life easier for a lot of developpers. I am afraid I am not exactly the right person to discuss the C libraries, as I don't actually use the C MINC library. I wanted to raise the issue hoping that other people (Nico ? Pierrick ? Vlad ?) would jump into the discussion. I had the feeling that EZminc was developped to cope with some shortcomings of the existing libraries. > I am going to break a taboo, but I believe that to reach a wider audience, > it is mandatory that MINC tools work with NIFTI. Whether we like it or not, > NIFTI is by far the most widely used format currently. > > Trust me, you are not the first to suggest this... I too have had > thoughts of doing this but a few things always stop me before I go too > far. The main concern is that while you can read NIFTI in one case it > doesn't mean you can read them all (consistently). The stand out > problem being of course "radio" vs "neurological" format files. > I am currently looking into that for the NIAK nifti reader/writer, and at this stage I don't think I mastered the subtleties of NIFTI space orientation. In any case, what I plan on doing is reproduce most of the header from the input into the output. In most operations, being in "radio" or "neurological" convention does not matter. The only scenario I can think of where that would be a problem would be coregistering two volumes under different conventions. > > Despite that problem that saving files flipped vs unflipped is > somewhat daft (change the viewer not the data), the main issue is that > you don't know from looking at the file itself. That and as soon as > you read another format the assumption is that the conversion is > perfect (and in both directions). I myself HIGHLY value that I always > know that the orientation and world positioning of my files is 100% > bang on. (Thanks Peter Neelin! :) For that I am prepared to run > nii2mnc and mnc2nii from time to time. > I do agree that the MINC files have straightforward orientation infos and that it is extremely valuable. Getting MINC tools to enter, say, NIFTI and produce MINC sounds dangerous, but as long as you stay in one format I don't see major problems. > > Still, I am not going to stop you... :) > > Good ! I am not exactly proposing to do it myself though, at least at this stage. Just testing the idea ... > Confining MINC tools to the MINC format is I think a mistake. > > You might be surprised to know that MINC (well volume_io) can indeed > read another format called "free format". See start_volume_input() in > minc/volume_io/Volumes/input_volume.c > > Adding a NIFTI format to the list and adding another case statement > would not be hard. I'd just caution about writing it out again. > Perhaps just a dodgy system call to nii2mnc and a tmpfile? > > I don't like the solution of double conversion. You're pretty much bound to mess up with field values. Again, the easiest solution I see would be to keep somewhere a full version of the header of the input file, whatever its format may be, and have some header structure common to all three formats (MINC1, MINC2, NIFTI) that is used internally. When time comes to write, you use the original full header and just update the infos based on the common structure. I am not sure if that outline makes sense or if this is applicable with the existing C MINC libraries. But that's pretty much how I do it with NIAK. @Jason 1) yes, MINC could be easier to install. There are a series of packages > around for MAC, linux, etc., but clearer instructions or more centralized > locations for all that would indeed be good. That being said, anybody who > wants to install minc and is slightly persistent can get it done without > great difficulty. I guess it depends where you set your expectations. Basically mine are : download, untar, run a configuration script, voil?. Or better, get a package, say install, and it works. In Ubuntu, that's pretty much already how it is (minus some small glitches, see "testing" below). I am afraid such expectations are largely shared by end users. But I tried to install a 32 bits OSX 10.5 (or something along those lines) recently and it hasn't been smooth, to say the least. Central location/documentation are in place but I still think that there is room for marked improvements. I don't think that there is systematic testing of releases yet, and that's something that could be arranged easily across a couple of sites in order to make sure that the experience of new users is a pleasant one. > 2) How are the MINC C libraries difficult? Sure, the MINC 1 ICV stuff was > something only Peter ever understood, but volume-io is quite useable and > the MINC 2 API is actually glorious to use. As I have already confessed in my answer to Andrew, I don't actually use those libraries. I was just repeating things I heard to start a discussion. I guess I was successful, in a way. I would love to hear from Vlad where EZminc stands compared to the regular MINC C IO libraries. And you contradict yourself on the next line: there is an R reader for MINC (two, > in fact - mine, which is a bit simplistic, and Jim's, which is quite > glorious), there are two for matlab (EMMA and yours), there are two for > python (mine and John Sled's - which have suffered from not being released; > seelaunchpad.net/pyminc and launchpad.net/pyminctools for my morning's > remedy of that). There are three minc readers for ITK (ours, David Gobi's, > and Vladimir's). There are converters to and from the OBJ format for > Inventor and VTK among others. So no, I don't think it's hard to work with > MINC at all. I can only speak for my limited experience : Matlab/Octave. Emma is a pain. The current NIAK reader is not too bad, but slow and dirty (basically anything exotic will crash ungracefully). And it requires the MINC tools to be installed, so it does not make development with MINC straightforward either. So altogether, dealing with MINC in Matlab/Octave is not, at this stage, painless. In my spare time, I am working on a MINC1 & MINC2 reader/writer that directly use the NETCDF and HDF5 libraries of Matlab, and this seems to work *much* better. Unfortunately, those libraries don't exist in Octave, so this is not the ultimate solution. The python library has not been out for very long but it certainly is a great addition to the MINC arsenal, which I will definitely use myself. And I certainly see no reason why the MINC libraries have to read NIFTI - > there are enough meta-libs like ITK that can handle both if that's what a > user really wants. The reason is : make the MINC tools easy to use for the vast majority of neuroimaging applications. Meta-libs are one thing, but image analysis software that only deal with one file format while ignoring the most common one are hard to find. On top of that, I don't think it would be that hard to do even though I don't know much about the design of the MINC C IO libraries (did I mention that before ?). > 3) I completely agree that a better development location and model would > help. We have this discussion on this list about once a year, with those > outside the BIC agreeing, and those inside the BIC just remaining silent. > Louis? Claude? Anyone? The fact that MINC is hidden behind the MNI's SSH > access is ridiculous. Something like launchpad, githug, google code, > anything would be better than its current fortified location. But I don't > think we can force a centralized prioritization of development - different > labs will do what they have interest in and resources for. Centralized prioritization is indeed not something that is feasible or that I would want to do anyway. But there could be some initiatives taken as a community and we could probably find some funds for that. The python IO libraries is an obvious example of a development that would benefit everyone. Having a forum (like a MINC meeting at HBM or a MINC workshop or tconf) to discuss such initiatives would help keeping the community aware of what's going on and stay as active as can be. > > And I also don't agree that nothing is being developed with MINC anymore - > there are plenty of labs, not all of them in Montreal, that use MINC exclusively, > and do develop new stuff all the time. Hehe great to hear that. I do myself think that there are lots of good stuff currently developed in MINC, I guess I was being a bit provocative. Yet, some of the developments do not make it to MINC releases (EZMinc, CIVET, latest PVE estimation by Jussi Tohka and Jose Manjon amongst others). The improvements we've been talking about would help to feed the MINC bundle with cutting-edge developments. Sorry for the long post. Best regards, Pierre Bellec, PhD Chercheur adjoint Centre de recherche de l'institut de G?riatrie de Montr?al D?partement d'informatique et de recherche op?rationnelle Universit? de Montr?al http://simexp-lab.org/brainwiki/doku.php?id=pierrebellec (001)(514) 340 3540 #336730