From jared.rowley at gmail.com Mon Jul 1 13:23:06 2013 From: jared.rowley at gmail.com (Jared Rowley) Date: Mon, 1 Jul 2013 13:23:06 -0400 Subject: [MINC-users] porting obj files to other software packages Message-ID: Hi, I was wondering if anyone has experience trying to open obj file exported from Display in other software packages. (Specifically, I am trying to use cinema 4D to make some animations). I need the obj file to be a wavefront .obj file. The object file from display seems very similar file format but not exactly the same. If anyone has any experience or ideas please let me know. Thanks, Jared -- Jared Rowley Translational Neuroimaging Laboratory McGill Centre for Studies in Aging Douglas Hospital Research Center McGill University 6825 LaSalle Blvd. Montreal, QC Canada H4H 1R3 From eskild at gmail.com Tue Jul 2 03:25:29 2013 From: eskild at gmail.com (Simon Eskildsen) Date: Tue, 2 Jul 2013 09:25:29 +0200 Subject: [MINC-users] porting obj files to other software packages In-Reply-To: References: Message-ID: Hi Jared, I have a tool to convert to/from MNI obj. it supports various formats such as VTK, VRML, POV-Ray, etc. However, currently it does not support wavefront obj. Perhaps Cinema 4D takes other formats? There is an old thread with links to some binaries here: http://www.bic.mni.mcgill.ca/pipermail/minc-users/2007-October/001742.html I can provide a fresh compiled version if these do not work. S On Mon, Jul 1, 2013 at 7:23 PM, Jared Rowley wrote: > Hi, > > I was wondering if anyone has experience trying to open obj file exported > from Display in other software packages. (Specifically, I am trying to use > cinema 4D to make some animations). > > I need the obj file to be a wavefront .obj file. > > The object file from display seems very similar file format but not exactly > the same. > > If anyone has any experience or ideas please let me know. > > Thanks, > > Jared > > -- > Jared Rowley > Translational Neuroimaging Laboratory > McGill Centre for Studies in Aging > Douglas Hospital Research Center > McGill University > 6825 LaSalle Blvd. > Montreal, QC Canada > H4H 1R3 > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From jason at mouseimaging.ca Tue Jul 2 07:03:50 2013 From: jason at mouseimaging.ca (Jason Lerch) Date: Tue, 2 Jul 2013 07:03:50 -0400 Subject: [MINC-users] porting obj files to other software packages In-Reply-To: References: Message-ID: Hi all, I've previously used Blender for funky conversions - go to inventor first (converters exist), import into Blender and export to whatever you want. Jason On 2013-07-02, at 3:25 AM, Simon Eskildsen wrote: > Hi Jared, > > I have a tool to convert to/from MNI obj. it supports various formats such > as VTK, VRML, POV-Ray, etc. However, currently it does not support > wavefront obj. Perhaps Cinema 4D takes other formats? > There is an old thread with links to some binaries here: > http://www.bic.mni.mcgill.ca/pipermail/minc-users/2007-October/001742.html > > I can provide a fresh compiled version if these do not work. > > S > > On Mon, Jul 1, 2013 at 7:23 PM, Jared Rowley wrote: > >> Hi, >> >> I was wondering if anyone has experience trying to open obj file exported >> from Display in other software packages. (Specifically, I am trying to use >> cinema 4D to make some animations). >> >> I need the obj file to be a wavefront .obj file. >> >> The object file from display seems very similar file format but not exactly >> the same. >> >> If anyone has any experience or ideas please let me know. >> >> Thanks, >> >> Jared >> >> -- >> Jared Rowley >> Translational Neuroimaging Laboratory >> McGill Centre for Studies in Aging >> Douglas Hospital Research Center >> McGill University >> 6825 LaSalle Blvd. >> Montreal, QC Canada >> H4H 1R3 >> _______________________________________________ >> MINC-users at bic.mni.mcgill.ca >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users >> > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From jared.rowley at gmail.com Tue Jul 2 23:29:51 2013 From: jared.rowley at gmail.com (Jared Rowley) Date: Tue, 2 Jul 2013 23:29:51 -0400 Subject: [MINC-users] porting obj files to other software packages In-Reply-To: References: Message-ID: Thank you Simon and Jason for the suggestions. They sound promising. Unfortunately my computer seems to have crashed so I haven't been able to try them out yet. I will report back in the future once I have solved my computer problems. Jared On Tuesday, July 2, 2013, Jason Lerch wrote: > Hi all, > > I've previously used Blender for funky conversions - go to inventor first > (converters exist), import into Blender and export to whatever you want. > > Jason > > On 2013-07-02, at 3:25 AM, Simon Eskildsen > > wrote: > > > Hi Jared, > > > > I have a tool to convert to/from MNI obj. it supports various formats > such > > as VTK, VRML, POV-Ray, etc. However, currently it does not support > > wavefront obj. Perhaps Cinema 4D takes other formats? > > There is an old thread with links to some binaries here: > > > http://www.bic.mni.mcgill.ca/pipermail/minc-users/2007-October/001742.html > > > > I can provide a fresh compiled version if these do not work. > > > > S > > > > On Mon, Jul 1, 2013 at 7:23 PM, Jared Rowley > > wrote: > > > >> Hi, > >> > >> I was wondering if anyone has experience trying to open obj file > exported > >> from Display in other software packages. (Specifically, I am trying to > use > >> cinema 4D to make some animations). > >> > >> I need the obj file to be a wavefront .obj file. > >> > >> The object file from display seems very similar file format but not > exactly > >> the same. > >> > >> If anyone has any experience or ideas please let me know. > >> > >> Thanks, > >> > >> Jared > >> > >> -- > >> Jared Rowley > >> Translational Neuroimaging Laboratory > >> McGill Centre for Studies in Aging > >> Douglas Hospital Research Center > >> McGill University > >> 6825 LaSalle Blvd. > >> Montreal, QC Canada > >> H4H 1R3 > >> _______________________________________________ > >> MINC-users at bic.mni.mcgill.ca > >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > >> > > _______________________________________________ > > MINC-users at bic.mni.mcgill.ca > > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > -- Jared Rowley Translational Neuroimaging Laboratory McGill Centre for Studies in Aging Douglas Hospital Research Center McGill University 6825 LaSalle Blvd. Montreal, QC Canada H4H 1R3 From pgravel at bic.mni.mcgill.ca Wed Jul 3 17:49:40 2013 From: pgravel at bic.mni.mcgill.ca (Paul GRAVEL) Date: Wed, 3 Jul 2013 17:49:40 -0400 (EDT) Subject: [MINC-users] xfm2param -scale option does not do anything In-Reply-To: References: Message-ID: Dear All, There is probably a reason for that, but I want to create an xfm file with scaling parameters, but it does not seem to work, i.e. the scale parameters don't appear and I only get the identity transformation matrix as seen below. Any enlightenment would be appreciated! Best, Paul ________________________________________________ This is what I did and obtained: % param2xfm -scales 0.2 0.2 0 test_scale_2D.xfm % xfm2param test_scale_2D.xfm after parameter extraction -center 0.00000 0.00000 0.00000 -translation 0.00000 0.00000 0.00000 -rotation 0.00000 0.00000 0.00000 -scale 1.00000 1.00000 1.00000 -shear 0.00000 0.00000 0.00000 % cat test_scale_2D.xfm MNI Transform File %Wed Jul 3 17:46:00 2013>>> param2xfm -scales 0.2 0.2 0 test_scale_2D.xfm %(Package mni_autoreg 0.99.3, compiled by rotor at gack (i686-pc-cygwin) on Fri Nov 3 00:19:37 EST 2006) Transform_Type = Linear; Linear_Transform = 1 0 0 0 0 1 0 0 0 0 1 0; From mallar.chak at gmail.com Wed Jul 3 17:56:31 2013 From: mallar.chak at gmail.com (Mallar Chakravarty) Date: Wed, 3 Jul 2013 17:56:31 -0400 Subject: [MINC-users] xfm2param -scale option does not do anything In-Reply-To: References: Message-ID: Hey Paul, I suspect you don't mean to have a zero in the z-dimension (ie: you want to keep that dim as is). If that's the case then try -scales 0.2 0.2 1. That should output an acceptable .xfm file. mallar On Wed, Jul 3, 2013 at 5:49 PM, Paul GRAVEL wrote: > Dear All, > > There is probably a reason for that, but I want to create an xfm file with > scaling parameters, but it does not seem to work, i.e. the scale parameters > don't appear and I only get the identity transformation matrix as seen > below. > > Any enlightenment would be appreciated! > > Best, > > Paul > ______________________________**__________________ > This is what I did and obtained: > > % param2xfm -scales 0.2 0.2 0 test_scale_2D.xfm > > % xfm2param test_scale_2D.xfm > after parameter extraction > -center 0.00000 0.00000 0.00000 > -translation 0.00000 0.00000 0.00000 > -rotation 0.00000 0.00000 0.00000 > -scale 1.00000 1.00000 1.00000 > -shear 0.00000 0.00000 0.00000 > > % cat test_scale_2D.xfm > MNI Transform File > %Wed Jul 3 17:46:00 2013>>> param2xfm -scales 0.2 0.2 0 test_scale_2D.xfm > %(Package mni_autoreg 0.99.3, compiled by rotor at gack (i686-pc-cygwin) on > Fri Nov 3 00:19:37 EST 2006) > > Transform_Type = Linear; > Linear_Transform = > 1 0 0 0 > 0 1 0 0 > 0 0 1 0; > > > > > > > ______________________________**_________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/**mailman/listinfo/minc-users > From vladimir.fonov at gmail.com Wed Jul 3 17:59:00 2013 From: vladimir.fonov at gmail.com (Vladimir S. FONOV) Date: Wed, 03 Jul 2013 17:59:00 -0400 Subject: [MINC-users] xfm2param -scale option does not do anything In-Reply-To: References: Message-ID: <51D49EA4.6030601@gmail.com> Hello, indeed.... param2xfm -scale 0.2 0.2 0.00001 test_scale_2D.xfm works though it might have something to do with the fact that affine transformation with scaling of zero is not invertible. On 13-07-03 05:49 PM, Paul GRAVEL wrote: > Dear All, > > There is probably a reason for that, but I want to create an xfm file > with scaling parameters, but it does not seem to work, i.e. the scale > parameters don't appear and I only get the identity transformation > matrix as seen below. > > Any enlightenment would be appreciated! > > Best, > > Paul > ________________________________________________ > This is what I did and obtained: > > % param2xfm -scales 0.2 0.2 0 test_scale_2D.xfm > > % xfm2param test_scale_2D.xfm > after parameter extraction > -center 0.00000 0.00000 0.00000 > -translation 0.00000 0.00000 0.00000 > -rotation 0.00000 0.00000 0.00000 > -scale 1.00000 1.00000 1.00000 > -shear 0.00000 0.00000 0.00000 > > % cat test_scale_2D.xfm > MNI Transform File > %Wed Jul 3 17:46:00 2013>>> param2xfm -scales 0.2 0.2 0 test_scale_2D.xfm > %(Package mni_autoreg 0.99.3, compiled by rotor at gack (i686-pc-cygwin) on > Fri Nov 3 00:19:37 EST 2006) > > Transform_Type = Linear; > Linear_Transform = > 1 0 0 0 > 0 1 0 0 > 0 0 1 0; > > > > > > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users -- Best regards, Vladimir S. FONOV ~ vladimir.fonov gmail.com From pgravel at bic.mni.mcgill.ca Wed Jul 3 18:05:33 2013 From: pgravel at bic.mni.mcgill.ca (Paul GRAVEL) Date: Wed, 3 Jul 2013 18:05:33 -0400 (EDT) Subject: [MINC-users] xfm2param -scale option does not do anything In-Reply-To: <51D49EA4.6030601@gmail.com> References: <51D49EA4.6030601@gmail.com> Message-ID: Thanks Mallar and Vladimir! Indeed it does work! I guess my head is stuck somewhere it shouldn't be ;-)! Apologies to all for swamping your email accounts with such questions... Best, Paul On Wed, 3 Jul 2013, Vladimir S. FONOV wrote: > Hello, > > indeed.... param2xfm -scale 0.2 0.2 0.00001 test_scale_2D.xfm works though > > it might have something to do with the fact that affine transformation with > scaling of zero is not invertible. > > On 13-07-03 05:49 PM, Paul GRAVEL wrote: >> Dear All, >> >> There is probably a reason for that, but I want to create an xfm file >> with scaling parameters, but it does not seem to work, i.e. the scale >> parameters don't appear and I only get the identity transformation >> matrix as seen below. >> >> Any enlightenment would be appreciated! >> >> Best, >> >> Paul >> ________________________________________________ >> This is what I did and obtained: >> >> % param2xfm -scales 0.2 0.2 0 test_scale_2D.xfm >> >> % xfm2param test_scale_2D.xfm >> after parameter extraction >> -center 0.00000 0.00000 0.00000 >> -translation 0.00000 0.00000 0.00000 >> -rotation 0.00000 0.00000 0.00000 >> -scale 1.00000 1.00000 1.00000 >> -shear 0.00000 0.00000 0.00000 >> >> % cat test_scale_2D.xfm >> MNI Transform File >> %Wed Jul 3 17:46:00 2013>>> param2xfm -scales 0.2 0.2 0 test_scale_2D.xfm >> %(Package mni_autoreg 0.99.3, compiled by rotor at gack (i686-pc-cygwin) on >> Fri Nov 3 00:19:37 EST 2006) >> >> Transform_Type = Linear; >> Linear_Transform = >> 1 0 0 0 >> 0 1 0 0 >> 0 0 1 0; >> >> >> >> >> >> >> _______________________________________________ >> MINC-users at bic.mni.mcgill.ca >> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > > -- > Best regards, > > Vladimir S. FONOV ~ vladimir.fonov gmail.com > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From a.janke at gmail.com Wed Jul 3 21:08:02 2013 From: a.janke at gmail.com (Andrew Janke) Date: Thu, 4 Jul 2013 11:08:02 +1000 Subject: [MINC-users] xfm2param -scale option does not do anything In-Reply-To: <51D49EA4.6030601@gmail.com> References: <51D49EA4.6030601@gmail.com> Message-ID: Hi all, > indeed.... param2xfm -scale 0.2 0.2 0.00001 test_scale_2D.xfm works though > > it might have something to do with the fact that affine transformation with > scaling of zero is not invertible. I'd say Vlad is right but on a quick look I can't see where this happens. My guess is that this is an artifact of the NR code (with associated +1 indicies) in minctracc that does the transformations. The multiplication of such things is done here: https://github.com/BIC-MNI/mni_autoreg/blob/master/minctracc/Numerical/matrix_basics.c#L810 >From when the affine matrix is built here: https://github.com/BIC-MNI/mni_autoreg/blob/master/minctracc/Numerical/make_rots.c#L236 I would argue that while this makes sense regarding generating an invertible xfm for registration purposes it's not the entirely correct answer. The resulting transformation should have been just on a plane not the identity matrix. Seems that more investigation is needed on this one. a From vladimir.fonov at gmail.com Thu Jul 4 07:38:32 2013 From: vladimir.fonov at gmail.com (Vladimir S. FONOV) Date: Thu, 4 Jul 2013 07:38:32 -0400 Subject: [MINC-users] xfm2param -scale option does not do anything In-Reply-To: References: <51D49EA4.6030601@gmail.com> Message-ID: Hello, I think it is here: https://github.com/BIC-MNI/libminc/blob/develop/volume_io/MNI_formats/gen_xfs.c#L65 - if( .... && compute_transform_inverse( ... so, if compute_transfor_inverse fails , then identity transform is allocated instead of supplied one On Wed, Jul 3, 2013 at 9:08 PM, Andrew Janke wrote: > Hi all, > >> indeed.... param2xfm -scale 0.2 0.2 0.00001 test_scale_2D.xfm works though >> >> it might have something to do with the fact that affine transformation with >> scaling of zero is not invertible. > > I'd say Vlad is right but on a quick look I can't see where this > happens. My guess is that this is an artifact of the NR code (with > associated +1 indicies) in minctracc that does the transformations. > The multiplication of such things is done here: > > https://github.com/BIC-MNI/mni_autoreg/blob/master/minctracc/Numerical/matrix_basics.c#L810 > > From when the affine matrix is built here: > > https://github.com/BIC-MNI/mni_autoreg/blob/master/minctracc/Numerical/make_rots.c#L236 > > I would argue that while this makes sense regarding generating an > invertible xfm for registration purposes it's not the entirely correct > answer. The resulting transformation should have been just on a plane > not the identity matrix. Seems that more investigation is needed on > this one. > > > a > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users -- Best regards, Vladimir S. Fonov ~ vladimir fonov gmail com From francois.tadel at mcgill.ca Mon Jul 22 12:09:01 2013 From: francois.tadel at mcgill.ca (=?ISO-8859-1?Q?Fran=E7ois_Tadel?=) Date: Mon, 22 Jul 2013 12:09:01 -0400 Subject: [MINC-users] MINC support in Brainstorm Message-ID: <51ED591D.9090508@mcgill.ca> Dear colleagues, At the McGill MEG lab, we develop and support an open-source Matlab/Java-based environment for MEG/EEG/sEEG/ECOG processing and source reconstruction named Brainstorm: http://neuroimage.usc.edu/brainstorm http://neuroimage.usc.edu/brainstorm/Screenshots http://neuroimage.usc.edu/brainstorm/Community It is already widely used in the world and supports natively many file formats for all sorts of data types. As we use the individual anatomy of the subjects/patients to estimate and visualize the cortical activity, we provide a variety of user-friendly tools for displaying and manipulating MRI volumes and surfaces. To open this analysis platform to the users at the Neuro, we are working on adding an easy support of the .mnc format for structural T1-weighted volumes in Brainstorm. For now, we are using mnc2nii to convert the volumes to a NIfTI format before reading them. This works as a temporary solution, but leads to a few questions: 1) There is no current distribution of mnc2nii for Windows systems. I found an old one on a website (I didn't keep track of where), but that is probably outdated: program: 2.0.15 libminc: 2.0.15 netcdf : 3.5.0 HDF5 : 1.6.7 => Is there a way to get a new build (and regular updates) of this program for Windows systems? => Can we re-distribute this Windows version of mnc2nii as part of the main distribution of Brainstorm? 2) The mnc2nii solution is not going to be a valid long-term solution for one specific reason: the import of the CIVET output surfaces in Brainstorm. By converting to NIfTI, we lose the initial MINC coordinate system, on which all the CIVET output is based. If I don't have access to the origin of the referential, I don't think I can register correctly the cortical envelopes generated by CIVET with the corresponding T1 MRI. Therefore we will need a different solution for importing the MINC volumes. 3) Since HDF5 and netCDF are formats that are fully supported in many platform-independent languages (Java, Matlab, Python), will there be at some point a MINC reader available that does not rely on any external compiled library? I looked at Pierre Bellec's Matlab functions (http://code.google.com/p/mominc/), but for what I understood it does the reading of the HDF5/netCDF contents and does not provide any tool to re-orient the the volume in another standard coordinate system (such as NIfTI). There is probably not much to add to get a Matlab-based (or Java-based) version of mnc2nii (that reads the MINC volume into a NIfTI-oriented volume but with the full MINC header information). Are there other solutions readily available to help us with this MINC import? Is anybody working on or interested in those aspects at the present time? Those would be very helpful tools for us and probably for the developers of other software packages as well. We would be willing to help for any new developments in this direction, and more generally support the integration between the different software environments at the Neuro. Thanks Francois -- Fran?ois Tadel, MSc MEG / McConnell Brain Imaging Center / MNI / McGill University 3801 rue University, Montreal, QC H3A2B4, Canada From a.janke at gmail.com Tue Jul 23 03:03:51 2013 From: a.janke at gmail.com (Andrew Janke) Date: Tue, 23 Jul 2013 17:03:51 +1000 Subject: [MINC-users] MINC support in Brainstorm In-Reply-To: <51ED591D.9090508@mcgill.ca> References: <51ED591D.9090508@mcgill.ca> Message-ID: Hi Fran?ois On 23 July 2013 02:09, Fran?ois Tadel wrote: > At the McGill MEG lab, we develop and support an open-source > Matlab/Java-based environment for MEG/EEG/sEEG/ECOG processing and source > reconstruction named Brainstorm: > > To open this analysis platform to the users at the Neuro, we are working on > adding an easy support of the .mnc format for structural T1-weighted volumes > in Brainstorm. For now, we are using mnc2nii to convert the volumes to a > NIfTI format before reading them. mnc2nii does output the co-ordinate information to the nii file but there are a few ways of interpreting this, are you using niftilib to import into your software? If so it has been on my "list of things to do one day" to update mnc2nii to use this at which point this problem should go away. Another option is to take advantage of the work that Vladimir has done with ITK and minc integration. While a "heavier" solution it will allow you to read in many other imaging formats as well with very little work. There is also a "lite" version of MINC that works with ITK that only requires HDF. So, you have a choice, look into itk or I can work with someone in your group to get mnc2nii up to scratch for what you need. Thanks a From pfannmoelj at uni-greifswald.de Tue Jul 23 06:01:11 2013 From: pfannmoelj at uni-greifswald.de (Joerg Pfannmoeller) Date: Tue, 23 Jul 2013 12:01:11 +0200 Subject: [MINC-users] nu_correct: Error message during execution. In-Reply-To: <51ED591D.9090508@mcgill.ca> References: <51ED591D.9090508@mcgill.ca> Message-ID: <20130723120111.7f4c83053c16b4865b64b226@uni-greifswald.de> Hello, I executed the following command: nu_correct t1_tfl_mprage_7.mnc t1_tfl_mprage_7_corrected.mnc -distance 5 and received the following message during execution: Use of ?PATTERN? without explicit operator is deprecated at /usr/local/freesurfer/mni/bin/sharpen_volume line 153. Processing:..............................Done . . . Use of ?PATTERN? without explicit operator is deprecated at /usr/local/freesurfer/mni/bin/sharpen_volume line 153. Processing:..............................Done Number of iterations: 47 CV of field change: 0.000993017 Transforming slices:..............................Done Transforming slices:..............................Done The mincinfo on the input file is the following: file: t1_tfl_mprage_7.mnc image: signed__ short 0 to 3526 image dimensions: zspace yspace xspace dimension name length step start -------------- ------ ---- ----- zspace 30 0.28 0 yspace 1024 0.0292969 0 xspace 1024 0.0292969 0 Is the error message critical and needs a correction? If I need to correct something, what do I need to do? Sincerely yours Joerg From a.janke at gmail.com Tue Jul 23 06:35:57 2013 From: a.janke at gmail.com (Andrew Janke) Date: Tue, 23 Jul 2013 20:35:57 +1000 Subject: [MINC-users] nu_correct: Error message during execution. In-Reply-To: <20130723120111.7f4c83053c16b4865b64b226@uni-greifswald.de> References: <51ED591D.9090508@mcgill.ca> <20130723120111.7f4c83053c16b4865b64b226@uni-greifswald.de> Message-ID: Hi It's a warning only that has been fixed for the next release. Thanks A Sent via touchscreen, expict mistooks On 23/07/2013 8:04 PM, "Joerg Pfannmoeller" wrote: > Hello, > > I executed the following command: > > nu_correct t1_tfl_mprage_7.mnc t1_tfl_mprage_7_corrected.mnc -distance 5 > > and received the following message during execution: > > > > Use of ?PATTERN? without explicit operator is deprecated at > /usr/local/freesurfer/mni/bin/sharpen_volume line 153. > Processing:..............................Done > . > . > . > Use of ?PATTERN? without explicit operator is deprecated at > /usr/local/freesurfer/mni/bin/sharpen_volume line 153. > Processing:..............................Done > Number of iterations: 47 > CV of field change: 0.000993017 > Transforming slices:..............................Done > Transforming slices:..............................Done > > > > The mincinfo on the input file is the following: > > file: t1_tfl_mprage_7.mnc > image: signed__ short 0 to 3526 > image dimensions: zspace yspace xspace > dimension name length step start > -------------- ------ ---- ----- > zspace 30 0.28 0 > yspace 1024 0.0292969 0 > xspace 1024 0.0292969 0 > > > Is the error message critical and needs a correction? If I need to correct > something, what do I need to do? > > Sincerely yours Joerg > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From pierre.bellec at criugm.qc.ca Tue Jul 23 23:38:28 2013 From: pierre.bellec at criugm.qc.ca (Pierre Bellec) Date: Tue, 23 Jul 2013 23:38:28 -0400 Subject: [MINC-users] MINC support in Brainstorm In-Reply-To: <51ED591D.9090508@mcgill.ca> References: <51ED591D.9090508@mcgill.ca> Message-ID: Dear Fran?ois (and Andrew), > > > 2) The mnc2nii solution is not going to be a valid long-term solution for > one specific reason: the import of the CIVET output surfaces in Brainstorm. > By converting to NIfTI, we lose the initial MINC coordinate system, on > which all the CIVET output is based. If I don't have access to the origin > of the referential, I don't think I can register correctly the cortical > envelopes generated by CIVET with the corresponding T1 MRI. > Therefore we will need a different solution for importing the MINC volumes. > > As Andrew said, the conversion from minc to nifti should retain the correct voxel-to-world transformation. Hopefully this will be fixed once and for all by Andrew with niftilib. Great to hear about that very useful future development. > 3) Since HDF5 and netCDF are formats that are fully supported in many > platform-independent languages (Java, Matlab, Python), will there be at > some point a MINC reader available that does not rely on any external > compiled library? > I looked at Pierre Bellec's Matlab functions (http://code.google.com/p/** > mominc/ ), but for what I understood it > does the reading of the HDF5/netCDF contents and does not provide any tool > to re-orient the the volume in another standard coordinate system (such as > NIfTI). > There is probably not much to add to get a Matlab-based (or Java-based) > version of mnc2nii (that reads the MINC volume into a NIfTI-oriented volume > but with the full MINC header information). > Are there other solutions readily available to help us with this MINC > import? > Is anybody working on or interested in those aspects at the present time? > > I have put some efforts in mominc from time to time, and I am confident a reliable reader can be implemented for minc1 and minc2 in matlab, and minc1 for octave. I haven't prototyped the writer, but it should work. A lot of what's left to do for the reader is to run some systematic test (with some fancy slice-based intensity normalization) and finalize the fields of the header to retain compatibility with the reader/writer in NIAK (which is a different beast altogether based on system calls to the minc tools). Regarding the limitation you mentioned on the re-orientation, I have added a few features from NIAK in minc_read (for MINC1 files only for now, MINC2 will crash). If you download the head revision of the code (I'll also send it to you by email) and run something like: [hdr,vol] = minc_read('test.mnc'); you'll get a field hdr.info.mat which is a 4 x 4 transformation matrix from voxel coordinates to world coordinates. If you want to get a list of world coordinates for each voxel (and assuming vol is 3D): ind = find(true(size(vol))); [x,y,z] = ind2sub(size(vol),ind); coord_w = minc_voxel2world([x,y,z],hdr.info.mat); COORD_W is an array (nb_voxel x 3) where each row is the world coordinates of one voxel in the volume. You can use MINC_WORLD2VOXEL to go the other way around. If you want to have a volume that has been resampled such that the first dimension is "left to right", the second is "caudal to rostral" and the third is "ventral to dorsal", and the voxel to world transformation has a diagonal matrix for rotation, with diagonal elements coding only for voxel size, I can implement that as well. Let me know if you think this could solve your problem and, if so, I'll help wrap that up. Best, Pierre Those would be very helpful tools for us and probably for the developers of > other software packages as well. We would be willing to help for any new > developments in this direction, and more generally support the integration > between the different software environments at the Neuro. > > Thanks > Francois > > > > -- > Fran?ois Tadel, MSc > MEG / McConnell Brain Imaging Center / MNI / McGill University > 3801 rue University, Montreal, QC H3A2B4, Canada > > ______________________________**_________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/**mailman/listinfo/minc-users > From thomas.funck at mail.mcgill.ca Wed Jul 24 11:30:08 2013 From: thomas.funck at mail.mcgill.ca (Thomas Funck) Date: Wed, 24 Jul 2013 15:30:08 +0000 Subject: [MINC-users] Display documentation Message-ID: <53F3FD0032C9CC4BA836E8F0FC28906530DBDC93@EXMBX2010-4.campus.MCGILL.CA> Hi, I'm looking for some documentation for using ".tag" files in Display. Apparently there used to be info at http://www.bic.mni.mcgill.ca/software/Display/Display.html, but this is no longer available. "man Display" doesn't have anything relevant either. Thanks for any info! Thomas From Jean-Francois.Malouin at bic.mni.mcgill.ca Wed Jul 24 12:45:00 2013 From: Jean-Francois.Malouin at bic.mni.mcgill.ca (Jean-Francois Malouin) Date: Wed, 24 Jul 2013 12:45:00 -0400 Subject: [MINC-users] Display documentation In-Reply-To: <53F3FD0032C9CC4BA836E8F0FC28906530DBDC93@EXMBX2010-4.campus.MCGILL.CA> References: <53F3FD0032C9CC4BA836E8F0FC28906530DBDC93@EXMBX2010-4.campus.MCGILL.CA> Message-ID: <20130724164500.GA4857@bic.mni.mcgill.ca> Hi, Can you try again using the same URL? BTW, good luck with it, this piece of info is 19 years old... jf * Thomas Funck [20130724 11:30]: > Hi, > > I'm looking for some documentation for using ".tag" files in Display. Apparently there used to be info at http://www.bic.mni.mcgill.ca/software/Display/Display.html, but this is no longer available. "man Display" doesn't have anything relevant either. > > Thanks for any info! > > Thomas > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From francois.tadel at mcgill.ca Wed Jul 24 13:11:58 2013 From: francois.tadel at mcgill.ca (=?ISO-8859-1?Q?Fran=E7ois_Tadel?=) Date: Wed, 24 Jul 2013 13:11:58 -0400 Subject: [MINC-users] MINC support in Brainstorm In-Reply-To: References: <51ED591D.9090508@mcgill.ca> Message-ID: <51F00ADE.3030601@mcgill.ca> Andrew, Pierre: Thank you very much for your responses and suggestions. For reading the nifti files, I'm using my own matlab-only function (attached here) that I wrote a few years ago. It's not supporting all the extensions of the nifti format, it reads only what we need in Brainstorm (volume, basic orientation of the cube, voxel size). So indeed, it's not that the voxel<=>world transformation is not present in the output of the mnc2nii file, it's just that I'm not reading it. Except for CIVET, all the other programs I know for MRI segmentation (FreeSurfer, BrainVISA, BrainSuite) are saving their surface files in MRI coordinates, there is no additional transform needed to get the correspondence MRI/surface. I guess this is why I never had to read those transformations properly. With these discussions, I realize it probably makes more sense for me to put efforts into reading correctly the transformation directly from the MINC format rather than going through the nifti format. I will try to use Pierre's code to get the information I need (voxel <=> world transformation). Apparently, it is also the easiest way for me to get a fully scripted function, with no compilation involved (easier to maintain and distribute). Matlab supports natively NetCDF and HDF5 formats, no need to redistribute additional libraries. Pierre: Can I distribute your code with the the main Brainstorm distribution in the "external" folder? Do you want to attach a copyright notice on top of what is already in the code? Thank you for you help! Francois On 23/07/2013 11:38 PM, Pierre Bellec wrote: > Dear Fran?ois (and Andrew), > >> >> 2) The mnc2nii solution is not going to be a valid long-term solution for >> one specific reason: the import of the CIVET output surfaces in Brainstorm. >> By converting to NIfTI, we lose the initial MINC coordinate system, on >> which all the CIVET output is based. If I don't have access to the origin >> of the referential, I don't think I can register correctly the cortical >> envelopes generated by CIVET with the corresponding T1 MRI. >> Therefore we will need a different solution for importing the MINC volumes. >> >> > As Andrew said, the conversion from minc to nifti should retain the correct > voxel-to-world transformation. Hopefully this will be fixed once and for > all by Andrew with niftilib. Great to hear about that very useful future > development. > > >> 3) Since HDF5 and netCDF are formats that are fully supported in many >> platform-independent languages (Java, Matlab, Python), will there be at >> some point a MINC reader available that does not rely on any external >> compiled library? >> I looked at Pierre Bellec's Matlab functions (http://code.google.com/p/** >> mominc/ ), but for what I understood it >> does the reading of the HDF5/netCDF contents and does not provide any tool >> to re-orient the the volume in another standard coordinate system (such as >> NIfTI). >> There is probably not much to add to get a Matlab-based (or Java-based) >> version of mnc2nii (that reads the MINC volume into a NIfTI-oriented volume >> but with the full MINC header information). >> Are there other solutions readily available to help us with this MINC >> import? >> Is anybody working on or interested in those aspects at the present time? >> >> > I have put some efforts in mominc from time to time, and I am confident a > reliable reader can be implemented for minc1 and minc2 in matlab, and minc1 > for octave. I haven't prototyped the writer, but it should work. A lot of > what's left to do for the reader is to run some systematic test (with some > fancy slice-based intensity normalization) and finalize the fields of the > header to retain compatibility with the reader/writer in NIAK (which is a > different beast altogether based on system calls to the minc tools). > Regarding the limitation you mentioned on the re-orientation, I have added > a few features from NIAK in minc_read (for MINC1 files only for now, MINC2 > will crash). If you download the head revision of the > code (I'll > also send it to you by email) and run something like: > > [hdr,vol] = minc_read('test.mnc'); > > you'll get a field hdr.info.mat which is a 4 x 4 transformation matrix from > voxel coordinates to world coordinates. If you want to get a list of world > coordinates for each voxel (and assuming vol is 3D): > > ind = find(true(size(vol))); > [x,y,z] = ind2sub(size(vol),ind); > coord_w = minc_voxel2world([x,y,z],hdr.info.mat); > > COORD_W is an array (nb_voxel x 3) where each row is the world coordinates > of one voxel in the volume. You can use MINC_WORLD2VOXEL to go the other > way around. If you want to have a volume that has been resampled such that > the first dimension is "left to right", the second is "caudal to rostral" > and the third is "ventral to dorsal", and the voxel to world transformation > has a diagonal matrix for rotation, with diagonal elements coding only for > voxel size, I can implement that as well. > > Let me know if you think this could solve your problem and, if so, I'll > help wrap that up. > > Best, > > Pierre > > Those would be very helpful tools for us and probably for the developers of >> other software packages as well. We would be willing to help for any new >> developments in this direction, and more generally support the integration >> between the different software environments at the Neuro. >> >> Thanks >> Francois >> -- Fran?ois Tadel, MSc MEG / McConnell Brain Imaging Center / MNI / McGill University 3801 rue University, Montreal, QC H3A2B4, Canada -------------- next part -------------- function [MRI, hdr] = in_mri_nii(MriFile) % IN_MRI_NII: Reads a structural NIfTI/Analyze MRI. % % USAGE: [MRI, hdr] = in_mri_nii(MriFile); % % INPUT: % - MriFile : name of file to open, WITH EXTENSION % % OUTPUT: % - MRI : Brainstorm MRI structure % % FORMATS: % - Analyze7.5 (.hdr/.img) % - NIFTI-1 (.hdr/.img or .nii) % @============================================================================= % This software is part of the Brainstorm software: % http://neuroimage.usc.edu/brainstorm % % Copyright (c)2000-2013 Brainstorm by the University of Southern California % This software is distributed under the terms of the GNU General Public License % as published by the Free Software Foundation. Further details on the GPL % license can be found at http://www.gnu.org/copyleft/gpl.html. % % FOR RESEARCH PURPOSES ONLY. THE SOFTWARE IS PROVIDED "AS IS," AND THE % UNIVERSITY OF SOUTHERN CALIFORNIA AND ITS COLLABORATORS DO NOT MAKE ANY % WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF % MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, NOR DO THEY ASSUME ANY % LIABILITY OR RESPONSIBILITY FOR THE USE OF THIS SOFTWARE. % % For more information type "brainstorm license" at command prompt. % =============================================================================@ % % Authors: Francois Tadel, 2008-2012 MRI = []; hdr = []; % ===== READ FILE ===== [filepath, baseName, extension] = bst_fileparts(MriFile); switch(lower(extension)) % NIFTI-1 (single file) : documentation at http://nifti.nimh.nih.gov/nifti-1/ case '.nii' fid = nifti_open_hdr(MriFile); if fid==-1, disp(sprintf('in_mri_nii : Error opening header file')); return; end % Read file header hdr = nifti_read_hdr(fid); if isempty(hdr), disp(sprintf('in_mri_nii : Error reading header file')); return; end % Read image (3D matrix) fseek(fid, double(hdr.dim.vox_offset), 'bof'); data = nifti_read_img(fid, hdr); fclose(fid); if isempty(data), disp('in_mri_nii : Error reading image file'); return; end % ANALYZE7.5 or NIFTI-1 (dual file .HDR/.IMG) case {'.hdr', '.img'} % Make sure that both .hdr and .img files are present hdrFilename = fullfile(filepath, [baseName '.hdr']); imgFilename = fullfile(filepath, [baseName '.img']); if ~file_exist(hdrFilename), disp(sprintf('in_mri_nii : Missing header file (%s)', hdrFilename)); return; end if ~file_exist(imgFilename), disp(sprintf('in_mri_nii : Missing image file (%s)', imgFilename)); return; end % Read header file [fid, byteOrder] = nifti_open_hdr(hdrFilename); if fid==-1, disp(sprintf('in_mri_nii : Error opening header file')); return; end hdr = nifti_read_hdr(fid); if isempty(hdr), disp(sprintf('in_mri_nii : Error reading header file')); return; end fclose(fid); % Read image file [fid, message] = fopen(imgFilename, 'r', byteOrder); if fid == -1, disp(sprintf('in_mri_nii : %s', message)); return; end data = nifti_read_img(fid, hdr); fclose(fid); otherwise error('Unsupported file format'); end % ===== UNITS ===== % === NIfTI UNITS === if ~isempty(hdr.nifti) if (hdr.nifti.xyzt_units ~= 0) % Convert spatial units xyzunits = bitand(hdr.nifti.xyzt_units,7); % 0x7 switch(xyzunits) case 1, xyzscale = 1000.000; % meters case 2, xyzscale = 1.000; % mm case 3, xyzscale = .001; % microns end if (xyzunits ~= 1) hdr.dim.pixdim(2:4) = hdr.dim.pixdim(2:4) * xyzscale; hdr.nifti.srow_x = hdr.nifti.srow_x * xyzscale; hdr.nifti.srow_y = hdr.nifti.srow_y * xyzscale; hdr.nifti.srow_z = hdr.nifti.srow_z * xyzscale; end % Convert temporal units tunits = bitand(hdr.nifti.xyzt_units,3*16+8); % 0x38 switch(tunits) case 8, tscale = 1000.000; % seconds case 16, tscale = 1.000; % msec case 32, tscale = .001; % microsec otherwise, tscale = 0; end if (tscale ~= 1) hdr.dim.pixdim(5) = hdr.dim.pixdim(5) * tscale; end % Change value in xyzt_units to reflect scale change hdr.nifti.xyzt_units = bitor(2,16); % 2=mm, 16=msec end % === ANALYZE UNITS === else switch (deblank(hdr.dim.vox_units)) case 'mm' factor = 1; case 'm' factor = 1000; otherwise factor = 1; end hdr.dim.pixdim(2:4) = (double(hdr.dim.pixdim(2:4)) * factor); end % ===== NIFTI ORIENTATION ===== if ~isempty(hdr.nifti) && ~isempty(hdr.nifti.vox2ras) % Normalize rotation matrix R = hdr.nifti.vox2ras(1:3,1:3); R = bst_bsxfun(@rdivide, R, sqrt(sum(R.^2))); % Binarize rotation matrix for i = 1:3 [val, Pmat(i)] = max(abs(R(i,:))); isFlip(i) = (R(i,Pmat(i)) < 0); end % Ask user if ~isequal(Pmat, [1 2 3]) || ~isequal(isFlip, [0 0 0]) isApply = java_dialog('confirm', ['A transformation is available in the MRI file.' 10 10 ... 'Do you want to apply it to the volume now?' 10 10], 'NIfTI MRI'); else isApply = 0; end % Apply transformations if isApply % Permute dimensions data = permute(data, Pmat); % Flip matrix for i = 1:3 if isFlip(i) data = flipdim(data,i); end end end end % ===== CREATE BRAINSTORM STRUCTURE ===== MRI = struct('Cube', data, ... 'Voxsize', abs(hdr.dim.pixdim(2:4)), ... 'Comment', 'MRI'); end %% ================================================================================================= % ====== HELPER FUNCTIONS ========================================================================= % ================================================================================================= %% ===== OPEN HEADER ===== function [fid, byteOrder] = nifti_open_hdr(MriFile) % Open file for reading only (trying little endian byte order) [fid, message] = fopen(MriFile, 'r', 'ieee-le'); if fid == -1, disp(sprintf('in_mri_nii : %s', message)); return; end % Detect data byte order (little endian or big endian) fseek(fid,40,'bof'); dim_zero = fread(fid,1,'uint16'); % dim_zero must be a number between 1 and 7, else try a big endian byte order if(dim_zero < 1 || dim_zero > 7) fclose(fid); fopen(MriFile, 'r', 'ieee-be'); fseek(fid,40,'bof'); dim_zero = fread(fid,1,'uint16'); if(dim_zero < 1 || dim_zero > 7) % ERROR fid = -1; return; end byteOrder = 'ieee-be'; else byteOrder = 'ieee-le'; end fseek(fid,0,'bof'); end %% ===== READ HEADER ===== % Reads an Analyze7.5 or a NIFTI-1 header file function hdr = nifti_read_hdr(fid) % ===== ANALYZE : Section 'header_key' ===== key.sizeof_hdr = fread(fid,1,'uint32'); key.data_type = char(fread(fid,[1,10],'uchar')); key.db_name = char(fread(fid,[1,18],'uchar')); key.extents = fread(fid,1,'uint32'); key.session_error = fread(fid,1,'uint16'); key.regular = char(fread(fid,1,'uchar')); key.hkey_un0 = char(fread(fid,1,'uchar')); % ===== ANALYZE : Section 'image_dimension' ===== dim.dim = fread(fid,[1,8],'uint16'); dim.vox_units = char(fread(fid,[1,4],'uchar')); dim.cal_units = char(fread(fid,[1,8],'uchar')); dim.unused1 = fread(fid,1,'uint16'); dim.datatype = fread(fid,1,'uint16'); dim.bitpix = fread(fid,1,'uint16'); dim.dim_un0 = fread(fid,1,'uint16'); dim.pixdim = fread(fid,[1,8],'float32'); % in disk it is a float !!!!!! dim.vox_offset = fread(fid,1,'float32'); % in disk it is a float !!!!!! dim.funused1 = fread(fid,1,'float32'); % in disk it is a float !!!!!! dim.funused2 = fread(fid,1,'float32'); % in disk it is a float !!!!!! dim.funused3 = fread(fid,1,'float32'); % in disk it is a float !!!!!! dim.cal_max = fread(fid,1,'float32'); % in disk it is a float !!!!!! dim.cal_min = fread(fid,1,'float32'); % in disk it is a float !!!!!! dim.compressed = fread(fid,1,'uint32'); dim.verified = fread(fid,1,'uint32'); dim.glmax = fread(fid,1,'uint32'); dim.glmin = fread(fid,1,'uint32'); % ===== ANALYZE : Section 'image_dimensions' ===== hist.descrip = char(fread(fid,[1,80],'uchar')); hist.aux_file = char(fread(fid,[1,24],'uchar')); hist.orient = fread(fid,1,'uchar'); hist.originator = fread(fid,[1,5],'int16'); hist.generated = char(fread(fid,[1,10],'uchar')); hist.scannum = char(fread(fid,[1,10],'uchar')); hist.patient_id = char(fread(fid,[1,10],'uchar')); hist.exp_date = char(fread(fid,[1,10],'uchar')); hist.exp_time = char(fread(fid,[1,10],'uchar')); hist.hist_un0 = char(fread(fid,[1,3],'uchar')); hist.views = fread(fid,1,'uint32'); hist.vols_added = fread(fid,1,'uint32'); hist.start_field = fread(fid,1,'uint32'); hist.field_skip = fread(fid,1,'uint32'); hist.omax = fread(fid,1,'uint32'); hist.omin = fread(fid,1,'uint32'); hist.smax = fread(fid,1,'uint32'); [hist.smin, cnt] = fread(fid,1,'uint32'); if (cnt ~= 1) error('Error opening file : Incomplete header'); end % ===== NIfTI-specific section ===== % Read identification string fseek(fid, 344, 'bof'); [nifti.magic, count] = fread(fid,[1,4],'uchar'); % Detect file type isNifti = ismember(deblank(char(nifti.magic)), {'ni1', 'n+1'}); % If file is a real NIfTI-1 file : read other values if isNifti nifti.dim_info = key.hkey_un0; fseek(fid, 56, 'bof'); nifti.intent_p1 = fread(fid,1,'float32'); nifti.intent_p2 = fread(fid,1,'float32'); nifti.intent_p3 = fread(fid,1,'float32'); nifti.intent_code = fread(fid,1,'uint16'); nifti.slice_start = dim.dim_un0; nifti.scl_slope = dim.funused1; nifti.scl_inter = dim.funused2; fseek(fid, 120, 'bof'); nifti.slice_end = fread(fid,1,'uint16'); nifti.slice_code = fread(fid,1,'uchar'); nifti.xyzt_units = fread(fid,1,'uchar'); nifti.slice_duration = dim.compressed; nifti.toffset = dim.verified; fseek(fid, 252, 'bof'); nifti.qform_code = fread(fid,1,'uint16'); nifti.sform_code = fread(fid,1,'uint16'); nifti.quatern_b = fread(fid,1,'float32'); nifti.quatern_c = fread(fid,1,'float32'); nifti.quatern_d = fread(fid,1,'float32'); nifti.qoffset_x = fread(fid,1,'float32'); nifti.qoffset_y = fread(fid,1,'float32'); nifti.qoffset_z = fread(fid,1,'float32'); nifti.srow_x = fread(fid,[1,4],'float32'); nifti.srow_y = fread(fid,[1,4],'float32'); nifti.srow_z = fread(fid,[1,4],'float32'); nifti.intent_name = fread(fid,[1,16],'uchar'); else nifti = []; end if (count ~= 4) error('Unknown error'); end % ===== NIFTI ORIENTATION ===== if ~isempty(nifti) % Sform matrix if ~isempty(nifti.srow_x) && ~isequal(nifti.srow_x, [0 0 0 0]) nifti.sform = [... nifti.srow_x; nifti.srow_y; nifti.srow_z; 0 0 0 1]; else nifti.sform = []; end % Qform matrix - not quite sure how all this works, % mainly just copied CH's code from mriio.c b = nifti.quatern_b; c = nifti.quatern_c; d = nifti.quatern_d; x = nifti.qoffset_x; y = nifti.qoffset_y; z = nifti.qoffset_z; a = 1.0 - (b*b + c*c + d*d); if(abs(a) < 1.0e-7) a = 1.0 / sqrt(b*b + c*c + d*d); b = b*a; c = c*a; d = d*a; a = 0.0; else a = sqrt(a); end r11 = a*a + b*b - c*c - d*d; r12 = 2.0*b*c - 2.0*a*d; r13 = 2.0*b*d + 2.0*a*c; r21 = 2.0*b*c + 2.0*a*d; r22 = a*a + c*c - b*b - d*d; r23 = 2.0*c*d - 2.0*a*b; r31 = 2.0*b*d - 2*a*c; r32 = 2.0*c*d + 2*a*b; r33 = a*a + d*d - c*c - b*b; if(dim.pixdim(1) < 0.0) r13 = -r13; r23 = -r23; r33 = -r33; end qMdc = [r11 r12 r13; r21 r22 r23; r31 r32 r33]; D = diag(dim.pixdim(2:4)); P0 = [x y z]'; nifti.qform = [qMdc*D P0; 0 0 0 1]; % Build final transformation matrix if (nifti.sform_code ~= 0) && ~isempty(nifti.sform) && ~isequal(nifti.sform(1:3,1:3),zeros(3)) && ~isequal(nifti.sform(1:3,1:3),eye(3)) nifti.vox2ras = nifti.sform; elseif (nifti.qform_code ~= 0) && ~isempty(nifti.qform) && ~isequal(nifti.qform(1:3,1:3),zeros(3)) && ~isequal(nifti.qform(1:3,1:3),eye(3)) nifti.vox2ras = nifti.qform; else nifti.vox2ras = []; end end % ===== Test header values ===== Ndim = dim.dim(1); % Number of dimensions Nt = dim.dim(5); % Number of time frames if ~(((Ndim == 4) && (Nt == 1)) || (Ndim == 3)) error('Support only for 3D data set' ); end % ===== Report results ===== hdr.key = key; hdr.dim = dim; hdr.hist = hist; hdr.nifti = nifti; end %% ===== READ IMG ===== function data = nifti_read_img(fid, hdr) % Data type to read switch (hdr.dim.datatype) % Analyze-compatible codes case {1,2}, datatype = 'uint8'; case 4, datatype = 'int16'; case 8, datatype = 'int32'; case 16, datatype = 'single'; case {32,64}, datatype = 'double'; % NIfTI-specific codes case 256, datatype = 'int8'; case 512, datatype = 'uint16'; case 768, datatype = 'uint32'; case 1024, datatype = 'int64'; case 1280, datatype = 'uint64'; otherwise, error('Unsupported data type'); end % Dimensions of the MRI Nx = hdr.dim.dim(2); % Number of pixels in X Ny = hdr.dim.dim(3); % Number of pixels in Y Nz = hdr.dim.dim(4); % Number of Z slices Nt = hdr.dim.dim(5); % Number of time frames if (Nt == 0) Nt = 1; end % Read data data = repmat(cast(1, datatype),[Nx,Ny,Nz,Nt]); Nxy = Nx*Ny; for t = 1:Nt, for z = 1:Nz, [temp, cont] = fread(fid, [Nx,Ny], datatype); if (cont ~= Nxy) % ERROR data = []; return; end data(:,:,z,t) = temp; end end end From a.janke at gmail.com Thu Jul 25 09:07:21 2013 From: a.janke at gmail.com (Andrew Janke) Date: Thu, 25 Jul 2013 23:07:21 +1000 Subject: [MINC-users] MINC support in Brainstorm In-Reply-To: <51F00ADE.3030601@mcgill.ca> References: <51ED591D.9090508@mcgill.ca> <51F00ADE.3030601@mcgill.ca> Message-ID: Hi Francois, > For reading the nifti files, I'm using my own matlab-only function (attached > here) that I wrote a few years ago. It's not supporting all the extensions > of the nifti format, it reads only what we need in Brainstorm (volume, basic > orientation of the cube, voxel size). I would highly recommend you take a look at niftilib for reading ANALYZE/Nifti files in your code. http://niftilib.sourceforge.net/ It has a MATLAB interface and is what nearly all the other packages use to read them so at least you will be consistent in your interpretation of the q and s-form transformations. > I will try to use Pierre's code to get the information I need (voxel <=> world > transformation). While I'm not against others writing their own native MINC readers I'm not for it. But then I also understand the pragmatic reasons as to why people write them. We make every effort to not change the internal MINC header structure but just be aware of things like slice intensity scaling if you are writing your own reader that might disregard such things. Thanks a From pierre.bellec at criugm.qc.ca Thu Jul 25 10:40:34 2013 From: pierre.bellec at criugm.qc.ca (Pierre Bellec) Date: Thu, 25 Jul 2013 10:40:34 -0400 Subject: [MINC-users] MINC support in Brainstorm In-Reply-To: <51F00ADE.3030601@mcgill.ca> References: <51ED591D.9090508@mcgill.ca> <51F00ADE.3030601@mcgill.ca> Message-ID: Dear Fran?ois, > For reading the nifti files, I'm using my own matlab-only function > (attached here) that I wrote a few years ago. It's not supporting all the > extensions of the nifti format, it reads only what we need in Brainstorm > (volume, basic orientation of the cube, voxel size). So indeed, it's not > that the voxel<=>world transformation is not present in the output of the > mnc2nii file, it's just that I'm not reading it. > > Except for CIVET, all the other programs I know for MRI segmentation > (FreeSurfer, BrainVISA, BrainSuite) are saving their surface files in MRI > coordinates, there is no additional transform needed to get the > correspondence MRI/surface. I guess this is why I never had to read those > transformations properly. > > With these discussions, I realize it probably makes more sense for me to > put efforts into reading correctly the transformation directly from the > MINC format rather than going through the nifti format. I will try to use > Pierre's code to get the information I need (voxel <=> world > transformation). > That would be the cleanest approach indeed. > Apparently, it is also the easiest way for me to get a fully scripted > function, with no compilation involved (easier to maintain and distribute). > Matlab supports natively NetCDF and HDF5 formats, no need to redistribute > additional libraries. > > Agreed, that's why despite all the work involved and the overlap with some other projects (including NIAK) I still felt it was necessary to get the MOMINC library done eventually. Pierre: Can I distribute your code with the the main Brainstorm > distribution in the "external" folder? > Absolutely. > Do you want to attach a copyright notice on top of what is already in the > code? > > Nope, MIT license in the code is fine. I'll try to finish a beta version that works with both MINC1 and MINC2 by next week. Best, Pierre > Thank you for you help! > Francois > > > > > On 23/07/2013 11:38 PM, Pierre Bellec wrote: > >> Dear Fran?ois (and Andrew), >> >> >>> 2) The mnc2nii solution is not going to be a valid long-term solution for >>> one specific reason: the import of the CIVET output surfaces in >>> Brainstorm. >>> By converting to NIfTI, we lose the initial MINC coordinate system, on >>> which all the CIVET output is based. If I don't have access to the origin >>> of the referential, I don't think I can register correctly the cortical >>> envelopes generated by CIVET with the corresponding T1 MRI. >>> Therefore we will need a different solution for importing the MINC >>> volumes. >>> >>> >>> As Andrew said, the conversion from minc to nifti should retain the >> correct >> voxel-to-world transformation. Hopefully this will be fixed once and for >> all by Andrew with niftilib. Great to hear about that very useful future >> development. >> >> >> 3) Since HDF5 and netCDF are formats that are fully supported in many >>> platform-independent languages (Java, Matlab, Python), will there be at >>> some point a MINC reader available that does not rely on any external >>> compiled library? >>> I looked at Pierre Bellec's Matlab functions ( >>> http://code.google.com/p/** >>> mominc/ >), >>> but for what I understood it >>> >>> does the reading of the HDF5/netCDF contents and does not provide any >>> tool >>> to re-orient the the volume in another standard coordinate system (such >>> as >>> NIfTI). >>> There is probably not much to add to get a Matlab-based (or Java-based) >>> version of mnc2nii (that reads the MINC volume into a NIfTI-oriented >>> volume >>> but with the full MINC header information). >>> Are there other solutions readily available to help us with this MINC >>> import? >>> Is anybody working on or interested in those aspects at the present time? >>> >>> >>> I have put some efforts in mominc from time to time, and I am confident >> a >> reliable reader can be implemented for minc1 and minc2 in matlab, and >> minc1 >> for octave. I haven't prototyped the writer, but it should work. A lot of >> what's left to do for the reader is to run some systematic test (with some >> fancy slice-based intensity normalization) and finalize the fields of the >> header to retain compatibility with the reader/writer in NIAK (which is a >> different beast altogether based on system calls to the minc tools). >> Regarding the limitation you mentioned on the re-orientation, I have added >> a few features from NIAK in minc_read (for MINC1 files only for now, MINC2 >> will crash). If you download the head revision of the >> code> >> (I'll >> >> also send it to you by email) and run something like: >> >> [hdr,vol] = minc_read('test.mnc'); >> >> you'll get a field hdr.info.mat which is a 4 x 4 transformation matrix >> from >> voxel coordinates to world coordinates. If you want to get a list of world >> coordinates for each voxel (and assuming vol is 3D): >> >> ind = find(true(size(vol))); >> [x,y,z] = ind2sub(size(vol),ind); >> coord_w = minc_voxel2world([x,y,z],hdr.**info.mat); >> >> COORD_W is an array (nb_voxel x 3) where each row is the world coordinates >> of one voxel in the volume. You can use MINC_WORLD2VOXEL to go the other >> way around. If you want to have a volume that has been resampled such that >> the first dimension is "left to right", the second is "caudal to rostral" >> and the third is "ventral to dorsal", and the voxel to world >> transformation >> has a diagonal matrix for rotation, with diagonal elements coding only for >> voxel size, I can implement that as well. >> >> Let me know if you think this could solve your problem and, if so, I'll >> help wrap that up. >> >> Best, >> >> Pierre >> >> Those would be very helpful tools for us and probably for the developers >> of >> >>> other software packages as well. We would be willing to help for any new >>> developments in this direction, and more generally support the >>> integration >>> between the different software environments at the Neuro. >>> >>> Thanks >>> Francois >>> >>> > -- > Fran?ois Tadel, MSc > MEG / McConnell Brain Imaging Center / MNI / McGill University > 3801 rue University, Montreal, QC H3A2B4, Canada > > From congel at gmail.com Fri Jul 26 16:05:37 2013 From: congel at gmail.com (Qingyang Li) Date: Fri, 26 Jul 2013 16:05:37 -0400 Subject: [MINC-users] Error when calling the function "bestlinreg_s" Message-ID: Hi all, I am new to MINC tool kit so please bear with my with my naive question. I was recommended to using BEaST for brain extraction, and BEaST calls some functions from MINC tool kit for some normalization steps required before the extraction steps. But I encounter an error which I don't know how to get around. The command I ran was beast_normalize anatomical_head.mnc anatomical_head_mni.nmc mnc_anat_to_mni.xfm -modeldir /home2/data/PublicProgram/Atlas/mni_icbm152_t1_tal_nlin_sym_09c/ The error message I got was : Can't use string ("-est_translations") as an ARRAY ref while "strict refs" in use at /opt/minc/bin/bestlinreg_s line 299. I took a look at the program "bestlinreg_s" and it's a perl code. I don't know perl at all so I have no idea how to trouble-shoot and solve this problem. Could you please help? I am using Ubuntu-10.04 and Perl v5.10.1 (*) built for x86_64-linux-gnu-thread-multi. Thanks, Yang ------ Qingyang Li Balance and focus. From pgravel at bic.mni.mcgill.ca Fri Jul 26 17:22:45 2013 From: pgravel at bic.mni.mcgill.ca (Paul GRAVEL) Date: Fri, 26 Jul 2013 17:22:45 -0400 (EDT) Subject: [MINC-users] minclookup unexpected behaviour In-Reply-To: References: Message-ID: Dear All, I have this odd behaviour when I run minclookup to extract labels passed as a for loop variable (actually the variable is label_no). Basically, I did echo my command line with the linux variables inserted to ensure the single quotes were properly placed, i.e.: echo-ing command (were label_no is set to 85): echo minclookup -discrete -lut_string "'$label_no $label_no'" $source_dir/$subject/'qfal_'$subject'_OFC_and_PFC_ROIs_dynPET1_space.mnc' $source_dir/$subject/'qfal_'$subject'_OFC_and_PFC_ROIs_dynPET1_space_label_no'$label_no'_tmp.mnc' Output: minclookup -discrete -lut_string '85 85' /hrrt/hrrt5/pgravel/Studies/Qfal/017/qfal_017_OFC_and_PFC_ROIs_dynPET1_space.mnc /hrrt/hrrt5/pgravel/Studies/Qfal/017/qfal_017_OFC_and_PFC_ROIs_dynPET1_space_label_no85_tmp.mnc So, if I copy/paste this output directly in linux, it does work fine. However, when I call the command directly without echo-ing, which is the whole purpose of this exercise ;-), i.e.: minclookup -discrete -lut_string "'$label_no $label_no'" $source_dir/$subject/'qfal_'$subject'_OFC_and_PFC_ROIs_dynPET1_space.mnc' $source_dir/$subject/'qfal_'$subject'_OFC_and_PFC_ROIs_dynPET1_space_label_no'$label_no'_tmp.mnc' I get the following error: First line has fewer than 2 values. which I can't figure out... am I missing something? As always, any help will be greatly appreciated! Best Regards, Paul From a.janke at gmail.com Sat Jul 27 04:40:27 2013 From: a.janke at gmail.com (Andrew Janke) Date: Sat, 27 Jul 2013 18:40:27 +1000 Subject: [MINC-users] minclookup unexpected behaviour In-Reply-To: References: Message-ID: Hi Paul, > I have this odd behaviour when I run minclookup to extract labels passed as > a for loop variable (actually the variable is label_no). > > echo minclookup -discrete -lut_string "'$label_no $label_no'" Without testing, I think you just want this: minclookup -discrete -lut_string "$label_no $label_no" ... in your shell script. a From a.janke at gmail.com Sat Jul 27 04:42:08 2013 From: a.janke at gmail.com (Andrew Janke) Date: Sat, 27 Jul 2013 18:42:08 +1000 Subject: [MINC-users] Error when calling the function "bestlinreg_s" In-Reply-To: References: Message-ID: Hi Yang On 27 July 2013 06:05, Qingyang Li wrote: > The command I ran was > beast_normalize anatomical_head.mnc anatomical_head_mni.nmc > mnc_anat_to_mni.xfm -modeldir > /home2/data/PublicProgram/Atlas/mni_icbm152_t1_tal_nlin_sym_09c/ > > The error message I got was : > > Can't use string ("-est_translations") as an ARRAY ref while "strict refs" > in use at /opt/minc/bin/bestlinreg_s line 299. I'm not entirely familiar with BEAST but it appears to have a bug, if you look at the start of the perl script and remove the line use strict; does it run? Thanks a From eskild at gmail.com Sat Jul 27 04:50:25 2013 From: eskild at gmail.com (Simon Eskildsen) Date: Sat, 27 Jul 2013 10:50:25 +0200 Subject: [MINC-users] Error when calling the function "bestlinreg_s" In-Reply-To: References: Message-ID: Hi Yang, This is actually something I stumbled upon earlier. Try Andrew's suggestion or fix the problem by changing line 30 of the bestlinreg_s script: trans => qw/-est_translations/, becomes: trans => [qw/-est_translations/], I would be happy if someone could make the change in the repository. Simon On Fri, Jul 26, 2013 at 10:05 PM, Qingyang Li wrote: > Hi all, > > I am new to MINC tool kit so please bear with my with my naive question. > > I was recommended to using BEaST for brain extraction, and BEaST calls > some functions from MINC tool kit for some normalization steps required > before the extraction steps. But I encounter an error which I don't know > how to get around. > > The command I ran was > beast_normalize anatomical_head.mnc anatomical_head_mni.nmc > mnc_anat_to_mni.xfm -modeldir > /home2/data/PublicProgram/Atlas/mni_icbm152_t1_tal_nlin_sym_09c/ > > The error message I got was : > > Can't use string ("-est_translations") as an ARRAY ref while "strict refs" > in use at /opt/minc/bin/bestlinreg_s line 299. > > I took a look at the program "bestlinreg_s" and it's a perl code. I don't > know perl at all so I have no idea how to trouble-shoot and solve this > problem. Could you please help? > > I am using Ubuntu-10.04 and Perl v5.10.1 (*) built for > x86_64-linux-gnu-thread-multi. > > Thanks, > > Yang > > ------ > Qingyang Li > > Balance and focus. > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From a.janke at gmail.com Sat Jul 27 06:55:34 2013 From: a.janke at gmail.com (Andrew Janke) Date: Sat, 27 Jul 2013 20:55:34 +1000 Subject: [MINC-users] Error when calling the function "bestlinreg_s" In-Reply-To: References: Message-ID: Hi Simon, On 27 July 2013 18:50, Simon Eskildsen wrote: > trans => [qw/-est_translations/], > > > I would be happy if someone could make the change in the repository. Seems that this is already done in Vlad's develop branch. https://github.com/BIC-MNI/EZminc/blob/develop/scripts/bestlinreg_s#L30 a From eskild at gmail.com Sat Jul 27 07:32:11 2013 From: eskild at gmail.com (Simon Eskildsen) Date: Sat, 27 Jul 2013 13:32:11 +0200 Subject: [MINC-users] Error when calling the function "bestlinreg_s" In-Reply-To: References: Message-ID: Hi Andrew, You're right. Eventually this will find its way to a release. Until then, Yang, you can either correct your own copy or switch to the github code development branch. Simon On Sat, Jul 27, 2013 at 12:55 PM, Andrew Janke wrote: > Hi Simon, > > On 27 July 2013 18:50, Simon Eskildsen wrote: > > trans => [qw/-est_translations/], > > > > > > I would be happy if someone could make the change in the repository. > > Seems that this is already done in Vlad's develop branch. > > https://github.com/BIC-MNI/EZminc/blob/develop/scripts/bestlinreg_s#L30 > > > a > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From pgravel at bic.mni.mcgill.ca Mon Jul 29 08:27:30 2013 From: pgravel at bic.mni.mcgill.ca (Paul GRAVEL) Date: Mon, 29 Jul 2013 08:27:30 -0400 (EDT) Subject: [MINC-users] minclookup unexpected behaviour In-Reply-To: References: Message-ID: Thanks Andrew, your method does work! Interestingly, if I echo the command using the double quotes as you mentioned, and then I copy/paste the command it does not work. However, calling it from the script, it does... I guess there are some shell subtleties I don't understand... Best, Paul On Sat, 27 Jul 2013, Andrew Janke wrote: > Hi Paul, > >> I have this odd behaviour when I run minclookup to extract labels passed as >> a for loop variable (actually the variable is label_no). >> >> echo minclookup -discrete -lut_string "'$label_no $label_no'" > > Without testing, I think you just want this: > > minclookup -discrete -lut_string "$label_no $label_no" ... > > in your shell script. > > > a > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From djrotenberg at gmail.com Mon Jul 29 12:13:00 2013 From: djrotenberg at gmail.com (David Rotenberg) Date: Mon, 29 Jul 2013 12:13:00 -0400 Subject: [MINC-users] Minctracc --Restrict-Deformation Analogue Message-ID: Hi All, I am attempting to restrict the deformation in a minctracc non-linear registration in the same manner as is possible with --Restrict-Deformation in mincANTS, however so far I haven't been able to determine a way to do this. Does anyone know how I should go about restricting the deformation to one dimension (i.e. y) only? Best Regards, David From congel at gmail.com Mon Jul 29 14:05:45 2013 From: congel at gmail.com (Qingyang Li) Date: Mon, 29 Jul 2013 14:05:45 -0400 Subject: [MINC-users] Error when calling the function "bestlinreg_s" Message-ID: Dear Andrew and Simon Thank you very much for your help!! Yang ------ Qingyang Li Balance and focus. On Sat, Jul 27, 2013 at 12:00 PM, 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. Error when calling the function "bestlinreg_s" (Qingyang Li) > 2. minclookup unexpected behaviour (Paul GRAVEL) > 3. Re: minclookup unexpected behaviour (Andrew Janke) > 4. Re: Error when calling the function "bestlinreg_s" (Andrew Janke) > 5. Re: Error when calling the function "bestlinreg_s" > (Simon Eskildsen) > 6. Re: Error when calling the function "bestlinreg_s" (Andrew Janke) > 7. Re: Error when calling the function "bestlinreg_s" > (Simon Eskildsen) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 26 Jul 2013 16:05:37 -0400 > From: Qingyang Li > To: minc-users at bic.mni.mcgill.ca > Subject: [MINC-users] Error when calling the function "bestlinreg_s" > Message-ID: > fq-mex48AOjMPSQ at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > Hi all, > > I am new to MINC tool kit so please bear with my with my naive question. > > I was recommended to using BEaST for brain extraction, and BEaST calls > some functions from MINC tool kit for some normalization steps required > before the extraction steps. But I encounter an error which I don't know > how to get around. > > The command I ran was > beast_normalize anatomical_head.mnc anatomical_head_mni.nmc > mnc_anat_to_mni.xfm -modeldir > /home2/data/PublicProgram/Atlas/mni_icbm152_t1_tal_nlin_sym_09c/ > > The error message I got was : > > Can't use string ("-est_translations") as an ARRAY ref while "strict refs" > in use at /opt/minc/bin/bestlinreg_s line 299. > > I took a look at the program "bestlinreg_s" and it's a perl code. I don't > know perl at all so I have no idea how to trouble-shoot and solve this > problem. Could you please help? > > I am using Ubuntu-10.04 and Perl v5.10.1 (*) built for > x86_64-linux-gnu-thread-multi. > > Thanks, > > Yang > > ------ > Qingyang Li > > Balance and focus. > > > ------------------------------ > > Message: 2 > Date: Fri, 26 Jul 2013 17:22:45 -0400 (EDT) > From: Paul GRAVEL > To: MINC users mailing list > Cc: Paul Gravel - McGill Account > Subject: [MINC-users] minclookup unexpected behaviour > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > Dear All, > > I have this odd behaviour when I run minclookup to extract labels passed > as a for loop variable (actually the variable is label_no). Basically, I > did echo my command line with the linux variables inserted to ensure the > single quotes were properly placed, i.e.: > > echo-ing command (were label_no is set to 85): > echo minclookup -discrete -lut_string "'$label_no $label_no'" > $source_dir/$subject/'qfal_'$subject'_OFC_and_PFC_ROIs_dynPET1_space.mnc' > > $source_dir/$subject/'qfal_'$subject'_OFC_and_PFC_ROIs_dynPET1_space_label_no'$label_no'_tmp.mnc' > > Output: > minclookup -discrete -lut_string '85 85' > > /hrrt/hrrt5/pgravel/Studies/Qfal/017/qfal_017_OFC_and_PFC_ROIs_dynPET1_space.mnc > > /hrrt/hrrt5/pgravel/Studies/Qfal/017/qfal_017_OFC_and_PFC_ROIs_dynPET1_space_label_no85_tmp.mnc > > > So, if I copy/paste this output directly in linux, it does work fine. > However, when I call the command directly without echo-ing, which is the > whole purpose of this exercise ;-), i.e.: > > minclookup -discrete -lut_string "'$label_no $label_no'" > $source_dir/$subject/'qfal_'$subject'_OFC_and_PFC_ROIs_dynPET1_space.mnc' > > $source_dir/$subject/'qfal_'$subject'_OFC_and_PFC_ROIs_dynPET1_space_label_no'$label_no'_tmp.mnc' > > I get the following error: > First line has fewer than 2 values. > > which I can't figure out... am I missing something? > > As always, any help will be greatly appreciated! > > Best Regards, > > Paul > > > ------------------------------ > > Message: 3 > Date: Sat, 27 Jul 2013 18:40:27 +1000 > From: Andrew Janke > To: MINC users mailing list > Cc: Paul Gravel - McGill Account > Subject: Re: [MINC-users] minclookup unexpected behaviour > Message-ID: > L-9K6Xv7w at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > Hi Paul, > > > I have this odd behaviour when I run minclookup to extract labels passed > as > > a for loop variable (actually the variable is label_no). > > > > echo minclookup -discrete -lut_string "'$label_no $label_no'" > > Without testing, I think you just want this: > > minclookup -discrete -lut_string "$label_no $label_no" ... > > in your shell script. > > > a > > > ------------------------------ > > Message: 4 > Date: Sat, 27 Jul 2013 18:42:08 +1000 > From: Andrew Janke > To: MINC users mailing list > Subject: Re: [MINC-users] Error when calling the function > "bestlinreg_s" > Message-ID: > < > CAG0CB20WCJX9U49aHX3OH_Y+vmQqTBLctbUfVv31ocCkDBkRgA at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > Hi Yang > > On 27 July 2013 06:05, Qingyang Li wrote: > > The command I ran was > > beast_normalize anatomical_head.mnc anatomical_head_mni.nmc > > mnc_anat_to_mni.xfm -modeldir > > /home2/data/PublicProgram/Atlas/mni_icbm152_t1_tal_nlin_sym_09c/ > > > > The error message I got was : > > > > Can't use string ("-est_translations") as an ARRAY ref while "strict > refs" > > in use at /opt/minc/bin/bestlinreg_s line 299. > > I'm not entirely familiar with BEAST but it appears to have a bug, if > you look at the start of the perl script and remove the line > > use strict; > > does it run? > > Thanks > > > a > > > ------------------------------ > > Message: 5 > Date: Sat, 27 Jul 2013 10:50:25 +0200 > From: Simon Eskildsen > To: MINC users mailing list > Subject: Re: [MINC-users] Error when calling the function > "bestlinreg_s" > Message-ID: > < > CAD3v437+xmW5-a2TZzDUa2Gtt47J_0TQUqpUmbCgeVa1SF9L3Q at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > Hi Yang, > > This is actually something I stumbled upon earlier. > > Try Andrew's suggestion or fix the problem by changing line 30 of the > bestlinreg_s script: > > trans => qw/-est_translations/, > > becomes: > > trans => [qw/-est_translations/], > > > I would be happy if someone could make the change in the repository. > > Simon > > > On Fri, Jul 26, 2013 at 10:05 PM, Qingyang Li wrote: > > > Hi all, > > > > I am new to MINC tool kit so please bear with my with my naive question. > > > > I was recommended to using BEaST for brain extraction, and BEaST calls > > some functions from MINC tool kit for some normalization steps required > > before the extraction steps. But I encounter an error which I don't know > > how to get around. > > > > The command I ran was > > beast_normalize anatomical_head.mnc anatomical_head_mni.nmc > > mnc_anat_to_mni.xfm -modeldir > > /home2/data/PublicProgram/Atlas/mni_icbm152_t1_tal_nlin_sym_09c/ > > > > The error message I got was : > > > > Can't use string ("-est_translations") as an ARRAY ref while "strict > refs" > > in use at /opt/minc/bin/bestlinreg_s line 299. > > > > I took a look at the program "bestlinreg_s" and it's a perl code. I don't > > know perl at all so I have no idea how to trouble-shoot and solve this > > problem. Could you please help? > > > > I am using Ubuntu-10.04 and Perl v5.10.1 (*) built for > > x86_64-linux-gnu-thread-multi. > > > > Thanks, > > > > Yang > > > > ------ > > Qingyang Li > > > > Balance and focus. > > _______________________________________________ > > MINC-users at bic.mni.mcgill.ca > > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > > > > ------------------------------ > > Message: 6 > Date: Sat, 27 Jul 2013 20:55:34 +1000 > From: Andrew Janke > To: MINC users mailing list > Subject: Re: [MINC-users] Error when calling the function > "bestlinreg_s" > Message-ID: > SbRk5uarCqKGxMJQ at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > Hi Simon, > > On 27 July 2013 18:50, Simon Eskildsen wrote: > > trans => [qw/-est_translations/], > > > > > > I would be happy if someone could make the change in the repository. > > Seems that this is already done in Vlad's develop branch. > > https://github.com/BIC-MNI/EZminc/blob/develop/scripts/bestlinreg_s#L30 > > > a > > > ------------------------------ > > Message: 7 > Date: Sat, 27 Jul 2013 13:32:11 +0200 > From: Simon Eskildsen > To: MINC users mailing list > Subject: Re: [MINC-users] Error when calling the function > "bestlinreg_s" > Message-ID: > 4Cra0+a7OhKjGfQpxefXfT01ogK2g at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > Hi Andrew, > > You're right. Eventually this will find its way to a release. Until then, > Yang, you can either correct your own copy or switch to the github code > development branch. > > Simon > > > On Sat, Jul 27, 2013 at 12:55 PM, Andrew Janke wrote: > > > Hi Simon, > > > > On 27 July 2013 18:50, Simon Eskildsen wrote: > > > trans => [qw/-est_translations/], > > > > > > > > > I would be happy if someone could make the change in the repository. > > > > Seems that this is already done in Vlad's develop branch. > > > > > https://github.com/BIC-MNI/EZminc/blob/develop/scripts/bestlinreg_s#L30 > > > > > > a > > _______________________________________________ > > MINC-users at bic.mni.mcgill.ca > > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > > > > ------------------------------ > > _______________________________________________ > 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 96, Issue 8 > ***************************************** > From a.janke at gmail.com Mon Jul 29 18:54:46 2013 From: a.janke at gmail.com (Andrew Janke) Date: Tue, 30 Jul 2013 08:54:46 +1000 Subject: [MINC-users] Minctracc --Restrict-Deformation Analogue In-Reply-To: References: Message-ID: Hi David, I'm not aware of a method of doing this in minctracc for nonlinear transformations. You can restrict such things in the linear stage using the -w_xxxx options but as far as I know this doesn't apply to nonlinear. You could try this: minctracc -nonlinear -w_translations 1 0.00001 0.000001 .... If I have to restrict nonlinear registration in 2D I typically fake it by taking the individual slices and registering them. (after increasing the step size in Z). a On 30 July 2013 02:13, David Rotenberg wrote: > Hi All, > > I am attempting to restrict the deformation in a minctracc non-linear > registration in the same manner as is possible with --Restrict-Deformation > in mincANTS, however so far I haven't been able to determine a way to do > this. Does anyone know how I should go about restricting the deformation to > one dimension (i.e. y) only? > > Best Regards, > > David > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users