4D to 3D Registration Question

Hello!

I had a quick question about registering 4D data to 3D data. I am trying to register a dsc nifti file to a t1 post contrast. In actuality I am registering the dsc data to a t2 that has been already registered to the t1+C because this usually gives better results. However, because I am using a 3D image as the reference, I am losing the 4th dimension of my dsc data. In effect only 1 timepoint is being registered to the structural image. I’m not sure how to go about fixing this. I have included the function I applied and the change in the nifti header matrix that occurs during the transformation. The two datasets have already been skull stripped.

align_epi_anat.py -dset1 dsc_strip.nii.gz -dset2 t2_strip_post.nii.gz -dset1to2 -dset1_strip None -dset2_strip None -suffix _post
3dAFNItoNIFTI dsc_strip_post+orig.

Preregistration dsc nifti header
data_type FLOAT32
dim1 128
dim2 128
dim3 19
dim4 1
datatype 16
pixdim1 1.875000
pixdim2 1.875000
pixdim3 4.000000
pixdim4 0.000000
cal_max 0.0000
cal_min 0.0000
file_type NIFTI-1+

Postregistration dsc nifti header
data_type INT16
dim1 128
dim2 128
dim3 19
dim4 120
datatype 4
pixdim1 1.875000
pixdim2 1.875000
pixdim3 4.000000
pixdim4 1.500000
cal_max 0.0000
cal_min 0.0000
file_type NIFTI-1+

Any help would be greatly appreciated! Thank you so much!
Samantha

If you swap your dset1 and dset2 datasets, you will essentially be doing the same as the epi to anat alignment the program was originally made for. That will include motion correction and alignment to a particular sub-brick volume that is by default the first (volume 0).

Thanks you for the help! Just a followup question, will that register the t2 to the dsc? I have multiple sets of images that I need to all be registered to the t1+C

It will register whichever direction you pick dset2to1 or the dset1to2 (the default). With 1to2, you don’t get motion correction. If DSC is the dset2, then you choose the dset2_base/epi_base as the alignment and registration sub-brick.

You can also align to the T1 dataset directly, but you would likely need another cost function. Since this method worked for your dataset with the dset1/2 options used, then the default cost function there is lpa+ZZ. You can use lpc or lpc+ZZ then to align to T1.

Alternatively, once transformations are computed between pairs of datasets, then you can concatenate transformations together, inverting the ones that are going in the opposite direction.