Hi Lyam,
I’ve had a look at your data, although the s-forms for both the structural and ROI images project into the same space ( as shown by FSLeyes ) to use a flirt transform on a secondary image it must be stored _identically_ to the original target, both in resolution and orientation.One way to proceed is to create the resampling matrix from ROI->Structural with flirt’s -usesqform option and then concatenate with highres2example_func.mat to obtain the correct transform from ROI to functional space.

Hope this helps,
Kind regards
Matthew
--------------------------------
Dr Matthew Webster
FMRIB Centre 
John Radcliffe Hospital
University of Oxford

On 12 Apr 2022, at 19:32, Lyam Bailey <[log in to unmask]> wrote:

Thanks, Matthew. I've uploaded the dataset

---------------------------------------------------------
Lyam Bailey, B.Sc., M.Sc. 
He / Him
Doctoral student & Lecturer
Department of Psychology & Neuroscience
Dalhousie University


From: FSL - FMRIB's Software Library <[log in to unmask]> on behalf of Matthew Webster <[log in to unmask]>
Sent: Tuesday, April 12, 2022 3:17 PM
To: [log in to unmask] <[log in to unmask]>
Subject: Re: [FSL] Difficulty transforming structural mask to functional space
 
CAUTION: The Sender of this email is not from within Dalhousie.

Hi Lyam,
                This seems quite strange as the transformed T1 is within the bounds of the functional image. Can you tar up an example data set ( example_func, highres, ROI and highres2example_func.mat ) and upload to:

https://oxfile.ox.ac.uk/oxfile/work/extBox?id=700839B35190E48BF

so we can check the data locally?

Kind Regards
Matthew
--------------------------------
Dr Matthew Webster
FMRIB Centre
John Radcliffe Hospital
University of Oxford

> On 12 Apr 2022, at 17:51, Lyam Bailey <[log in to unmask]> wrote:
>
> Hi Matthew,
>
> Thanks for the quick response. Yes, each mask is in subject-specific structural space. I've attached an image of an ROI I created for one subject, overlaid on that subject's T1 structural image. I tried using the flirt call to transform a T1 structural image to functional space as you suggested. The results look okay - a few voxels out of place, but overall it's mostly aligned (see the other attached image, which shows functional data overlaid onto the transformed-to-functional-space T1)
>
>
> From: FSL - FMRIB's Software Library <[log in to unmask]> on behalf of Matthew Webster <[log in to unmask]>
> Sent: Tuesday, April 12, 2022 12:39 PM
> To: [log in to unmask] <[log in to unmask]>
> Subject: Re: [FSL] Difficulty transforming structural mask to functional space
>
> CAUTION: The Sender of this email is not from within Dalhousie.
> Dear Lyam,
>   Can you confirm each mask is in the subject’s specific structural space, and appear fine when overload on the corresponding structural image in FSLeyes? Also if you use the same flirt call below on the subject’s structural image is it also mis-aligned with images in functional space?
>
> Kind Regards
> Matthew
> --------------------------------
> Dr Matthew Webster
> FMRIB Centre
> John Radcliffe Hospital
> University of Oxford
>
>> On 12 Apr 2022, at 16:20, Lyam Bailey <[log in to unmask]> wrote:
>>
>> Dear users,
>>
>> I created some ROIs (i.e., masks) in native structural space for a number of subjects, and would now like to transform those masks to native functional space. I have previously run feat (with non-linear transformation) for each subject, so I already have the necessary transformation matrices. I used the following command for the transformation:
>>
>> flirt -in ROI.nii.gz -ref example_func.nii.gz -init highres2example_func.mat -applyxfm -out ROI_in_func.nii.gz
>>
>> Here's the problem: when I overlaid some of the transformed ROIs onto some functional data from the same subject (a cope.nii.gz image from the output of first-level feat), it looks completely mis-aligned. See attached image. Red voxels = the functional data in native space, blue = the transformed ROI for lh postcentral gyrus (which should be in the same space).
>>
>> Is there something wrong with my flirt command, or should I be using something other than flirt? Any advice will be greatly appreciated.
>>
>> Regards
>> Lyam
>>
>> ---------------------------------------------------------
>> Lyam Bailey, B.Sc., M.Sc.
>> He / Him
>> Doctoral student & Lecturer
>> Department of Psychology & Neuroscience
>> Dalhousie University
>>
>> To unsubscribe from the FSL list, click the following link:
>> https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=FSL&A=1
>> <Screenshot from 2022-04-12 12-15-07.png>
>
>
> To unsubscribe from the FSL list, click the following link:
> https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=FSL&A=1
>
> To unsubscribe from the FSL list, click the following link:
> https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=FSL&A=1
> <func_over_transformed_t1.png><struct_ROI_over_t1.png>


########################################################################

To unsubscribe from the FSL list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=FSL&A=1

This message was issued to members of www.jiscmail.ac.uk/FSL, a mailing list hosted by www.jiscmail.ac.uk, terms & conditions are available athttps://www.jiscmail.ac.uk/policyandsecurity/


To unsubscribe from the FSL list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=FSL&A=1



To unsubscribe from the FSL list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=FSL&A=1