Re: [Freesurfer] coregistering with bbregister

2018-08-14 Thread Douglas N. Greve
Hi Ben, please remember to post the list. Answers below

On 08/14/2018 02:22 PM, Ben M wrote:
>
> External Email - Use Caution
>
> Hi Doug,
>
> Thanks again for your help!
>
> | It reslices the mov into the anatomical space. What do you mean when 
> you "load" them?
>
> I mean when I view the images in fsleyes they don't seem to be very 
> different, but I suppose that's because the reslicing is probably very 
> subtle to see.
>
> I just came across this post 
> https://mail.nmr.mgh.harvard.edu/pipermail//freesurfer/2014-February/036120.html,
>  
> in which you suggest running
>
> tkregister2 --mov func.nii --fstarg --reg register.dat --fslregout 
> fsl.mat --noedit
>
> to get an FSL-compatible registration. I'd also like to use fnirt, and 
> for that I need the affine transformation matrix from bbregister. I 
> think if I simply do:
>
> $ bbregister --t2 --lta /data/bbregister/reg.lta --mov 
> /data/mean_func.nii.gz --s 001
> $ tkregister2 --mov /data/mean_func.nii.gz --fstarg --reg 
> /data/bbregister/reg.lta --fslregout /data/fsl.mat --noedit
>
> tkregister2 will put the transformation matrix reg.lta in the 
> appropriate format for fnirt, right? Or do I still need to play around 
> with freesurfer's coordinate system?
It should be ok
>
> Best,
> Ben
>
>
> On Mon, Aug 13, 2018 at 10:11 PM, Douglas N. Greve 
> mailto:dgr...@mgh.harvard.edu>> wrote:
>
>
>
> On 08/13/2018 03:02 PM, Ben M wrote:
>
>
> External Email - Use Caution
>
> Hi Doug,
>
> Thank you very much for your response, it helped me a lot.
> I checked the examples of mri_vol2vol and for
> functional-to-structural registration I think I should do
>
> $ bbregister --t2 --lta /data/bbregister/reg.lta --mov
> /data/mean_func.nii.gz --s 001
> $ mri_vol2vol --lta /data/bbregister/reg.lta --mov
> /data/mean_func.nii.gz --fstarg --o func2anat.nii.gz --no-resample
>
> If I understood correctly, this will align mean_func with the
> structural image (orig.mgz I think). Is this correct?
>
> Yes
>
>
> I have two follow up questions if you don't mind:
>
> 1 - I'd like to get the file describing the affine
> registration of the functional to structural space for
> subsequent preprocessing. I think this should be the reg.lta
> (or reg.dat) file from the bbregister step, shouldn't it? This
> file contains the transformation matrix from functional to
> structural, is that correct?
>
> Yes. You may need info here to decode it:
> https://surfer.nmr.mgh.harvard.edu/fswiki/CoordinateSystems
> 
>
> 2 - does mri_vol2vol actually physically move the -mov image?
> I think it does, which is the --o func2anat image above.
> However when I load the mean_func and func2anat images, they
> don't seem to be different in terms of orientation. I suppose
> it's because it's difficult to see the transformation with the
> naked eye?
>
> It reslices the mov into the anatomical space. What do you mean
> when you "load" them?
>
>
> Best,
> Ben
>
>
>
>
> The information in this e-mail is intended only for the person to
> whom it is
> addressed. If you believe this e-mail was sent to you in error and
> the e-mail
> contains patient information, please contact the Partners
> Compliance HelpLine at
> http://www.partners.org/complianceline
>  . If the e-mail was sent
> to you in error
> but does not contain patient information, please contact the
> sender and properly
> dispose of the e-mail.
>
>

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

Re: [Freesurfer] coregistering with bbregister

2018-08-13 Thread Douglas N. Greve


On 08/13/2018 03:02 PM, Ben M wrote:
>
> External Email - Use Caution
>
> Hi Doug,
>
> Thank you very much for your response, it helped me a lot.
> I checked the examples of mri_vol2vol and for functional-to-structural 
> registration I think I should do
>
> $ bbregister --t2 --lta /data/bbregister/reg.lta --mov 
> /data/mean_func.nii.gz --s 001
> $ mri_vol2vol --lta /data/bbregister/reg.lta --mov 
> /data/mean_func.nii.gz --fstarg --o func2anat.nii.gz --no-resample
>
> If I understood correctly, this will align mean_func with the 
> structural image (orig.mgz I think). Is this correct?
Yes
>
> I have two follow up questions if you don't mind:
>
> 1 - I'd like to get the file describing the affine registration of the 
> functional to structural space for subsequent preprocessing. I think 
> this should be the reg.lta (or reg.dat) file from the bbregister step, 
> shouldn't it? This file contains the transformation matrix from 
> functional to structural, is that correct?
Yes. You may need info here to decode it: 
https://surfer.nmr.mgh.harvard.edu/fswiki/CoordinateSystems
> 2 - does mri_vol2vol actually physically move the -mov image? I think 
> it does, which is the --o func2anat image above. However when I load 
> the mean_func and func2anat images, they don't seem to be different in 
> terms of orientation. I suppose it's because it's difficult to see the 
> transformation with the naked eye?
It reslices the mov into the anatomical space. What do you mean when you 
"load" them?
>
> Best,
> Ben

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] coregistering with bbregister

2018-08-13 Thread Ben M
External Email - Use Caution

Hi Doug,

Thank you very much for your response, it helped me a lot.
I checked the examples of mri_vol2vol and for functional-to-structural
registration I think I should do

$ bbregister --t2 --lta /data/bbregister/reg.lta --mov
/data/mean_func.nii.gz --s 001
$ mri_vol2vol --lta /data/bbregister/reg.lta --mov /data/mean_func.nii.gz
--fstarg --o func2anat.nii.gz --no-resample

If I understood correctly, this will align mean_func with the structural
image (orig.mgz I think). Is this correct?

I have two follow up questions if you don't mind:

1 - I'd like to get the file describing the affine registration of the
functional to structural space for subsequent preprocessing. I think this
should be the reg.lta (or reg.dat) file from the bbregister step, shouldn't
it? This file contains the transformation matrix from functional to
structural, is that correct?
2 - does mri_vol2vol actually physically move the -mov image? I think it
does, which is the --o func2anat image above. However when I load the
mean_func and func2anat images, they don't seem to be different in terms of
orientation. I suppose it's because it's difficult to see the
transformation with the naked eye?

Best,
Ben
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] coregistering with bbregister

2018-08-12 Thread Douglas Greve



On 8/10/18 6:48 PM, Ben M wrote:


External Email - Use Caution

Hi Doug,

Thank you for your suggestions, I'll try them.
Could you please let me know if my code is actually doing what I 
intend it to do? Specifically, the idea is to perform 
functional-to-structural registration.


so first I did
$ bbregister --t2 --reg /data/bbregister/reg.dat --mov 
/data/mean_func.nii.gz --s 001
That is right. The only thing I would change is to use reg.lta instead 
of reg.dat. The lta file has more info in it and we're trying to get 
people to move to it.


I'm not sure if the --mov image should be the motion-corrected mean 
functional image or the skull-stripped anatomical image. I think if I 
want to do functional-to-structural registration it should actually be 
the anatomical image as --mov right? Or it doesn't matter which one I 
choose?

Yes, it matters. The mov should be the functional.


I then did
$ mri_vol2vol --mov /data/bet_structural.nii.gz --targ 
/data/brain.nii.gz --o /data/coregistered_structural.nii.gz --reg  
/data/bbregister/reg.dat --inv –-nearest
 which I thinks applies the transformation matrix to the structural 
image, am I correct? In this case it would be a 
structural-to-functional registration I think.

Did you see the examples (run mri_vol2vol --help)
So, if I intend to perform functional-to-structural registration I 
should actually rather do


$ bbregister --t2 --reg /data/bbregister/reg.dat --mov 
/data/bet_structural.nii.gz --s 001
$ mri_vol2vol --mov /data/mean_func.nii.gz --targ /data/brain.nii.gz 
--o /data/coregistered_functional.nii.gz --reg  
/data/bbregister/reg.dat --inv –-nearest


Could you please confirm if this is correct?

Thank you very much,
Ben




Sometimes the FSL initialization will fail. If you are using FS version
6, then run it without specifying --init-fsl and it will use mri_coreg,
which is more robust. If your anatomical and functional were acquired at
the same time, you might be able to get away with --init-header instead.

On 8/9/18 2:12 PM, Ben M wrote:
>//>/External Email - Use Caution />//>/Hi, />/I'm trying to coregister the strucural image to the mean functional />/image using bbregister, so after reconall I did: />//>/bbregister --t2 --init-fsl --reg /data/bbregister/reg.dat --mov />//data/mean_func.nii.gz --s 001 />//>/bet /data/structural.nii.gz /data/bet_structural.nii.gz />//>/#brain.nii.gz is the brain.mgz from reconall output (in freesurfer 
space) />/mri_vol2vol --mov /data/bet_structural.nii.gz --targ />//data/brain.nii.gz --o /data/coregistered_structural.nii.gz --reg />//data/bbregister/reg.dat --inv –-nearest />//>/But when I load the coregistered_structural.nii.gz and the />/mean_func.nii.gz they are not aligned. I'm sure I'm doing something />/wrong, could someone help me figure it out please? />//>/Thanks in advance, />/Ben/




___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] coregistering with bbregister

2018-08-10 Thread Ben M
External Email - Use Caution

Hi Doug,

Thank you for your suggestions, I'll try them.
Could you please let me know if my code is actually doing what I intend it
to do? Specifically, the idea is to perform functional-to-structural
registration.

so first I did
$ bbregister --t2 --reg /data/bbregister/reg.dat --mov
/data/mean_func.nii.gz --s 001

I'm not sure if the --mov image should be the motion-corrected mean
functional image or the skull-stripped anatomical image. I think if I want
to do functional-to-structural registration it should actually be the
anatomical image as --mov right? Or it doesn't matter which one I choose?

I then did
$ mri_vol2vol --mov /data/bet_structural.nii.gz --targ /data/brain.nii.gz
--o /data/coregistered_structural.nii.gz --reg  /data/bbregister/reg.dat
--inv –-nearest
 which I thinks applies the transformation matrix to the structural image,
am I correct? In this case it would be a structural-to-functional
registration I think.
So, if I intend to perform functional-to-structural registration I should
actually rather do

$ bbregister --t2 --reg /data/bbregister/reg.dat --mov
/data/bet_structural.nii.gz --s 001
$ mri_vol2vol --mov /data/mean_func.nii.gz --targ /data/brain.nii.gz --o
/data/coregistered_functional.nii.gz --reg  /data/bbregister/reg.dat --inv
–-nearest

Could you please confirm if this is correct?

Thank you very much,
Ben






Sometimes the FSL initialization will fail. If you are using FS version
6, then run it without specifying --init-fsl and it will use mri_coreg,
which is more robust. If your anatomical and functional were acquired at
the same time, you might be able to get away with --init-header instead.

On 8/9/18 2:12 PM, Ben M wrote:
>>* External Email - Use Caution
*>>* Hi,
*>* I'm trying to coregister the strucural image to the mean functional
*>* image using bbregister, so after reconall I did:
*>>* bbregister --t2 --init-fsl --reg /data/bbregister/reg.dat --mov
*>* /data/mean_func.nii.gz --s 001
*>>* bet /data/structural.nii.gz /data/bet_structural.nii.gz
*>>* #brain.nii.gz is the brain.mgz from reconall output (in freesurfer space)
*>* mri_vol2vol --mov /data/bet_structural.nii.gz --targ
*>* /data/brain.nii.gz --o /data/coregistered_structural.nii.gz --reg
*>* /data/bbregister/reg.dat --inv –-nearest
*>>* But when I load the coregistered_structural.nii.gz and the
*>* mean_func.nii.gz they are not aligned. I'm sure I'm doing something
*>* wrong, could someone help me figure it out please?
*>>* Thanks in advance,
*>* Ben*
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Re: [Freesurfer] coregistering with bbregister

2018-08-10 Thread Douglas Greve
Sometimes the FSL initialization will fail. If you are using FS version 
6, then run it without specifying --init-fsl and it will use mri_coreg, 
which is more robust. If your anatomical and functional were acquired at 
the same time, you might be able to get away with --init-header instead.


On 8/9/18 2:12 PM, Ben M wrote:


External Email - Use Caution

Hi,
I'm trying to coregister the strucural image to the mean functional 
image using bbregister, so after reconall I did:


bbregister --t2 --init-fsl --reg /data/bbregister/reg.dat --mov 
/data/mean_func.nii.gz --s 001


bet /data/structural.nii.gz /data/bet_structural.nii.gz

#brain.nii.gz is the brain.mgz from reconall output (in freesurfer space)
mri_vol2vol --mov /data/bet_structural.nii.gz --targ 
/data/brain.nii.gz --o /data/coregistered_structural.nii.gz --reg 
/data/bbregister/reg.dat --inv –-nearest


But when I load the coregistered_structural.nii.gz and the 
mean_func.nii.gz they are not aligned. I'm sure I'm doing something 
wrong, could someone help me figure it out please?


Thanks in advance,
Ben


___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


[Freesurfer] coregistering with bbregister

2018-08-09 Thread Ben M
External Email - Use Caution

Hi,
I'm trying to coregister the strucural image to the mean functional image
using bbregister, so after reconall I did:

bbregister --t2 --init-fsl --reg /data/bbregister/reg.dat --mov
/data/mean_func.nii.gz --s 001

bet /data/structural.nii.gz /data/bet_structural.nii.gz

#brain.nii.gz is the brain.mgz from reconall output (in freesurfer space)
mri_vol2vol --mov /data/bet_structural.nii.gz --targ /data/brain.nii.gz --o
/data/coregistered_structural.nii.gz --reg /data/bbregister/reg.dat --inv
–-nearest

But when I load the coregistered_structural.nii.gz and the mean_func.nii.gz
they are not aligned. I'm sure I'm doing something wrong, could someone
help me figure it out please?

Thanks in advance,
Ben
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.