KCL-BMEIS / niftyreg

This project contains command line tools to perform rigid, affine and non-linear registration of nifti or analyse images as well as utilities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Niftyreg (is there other option in the reg_aladin that generates parameters' to be used in the Reg_resample?)

skgtohn opened this issue · comments

Hi,

I used the niftyreg reigstraiton method with this command: reg_aladin -ref $REF_IMG -flo ${file} -res "${OUTPUT_DIR}/$(basename ${file%..})_affine.nii.gz" -aff "${OUTPUT_DIR}/$(basename ${file%..})_affine.txt" -ln 3 -maxit 1000

So the registered output is generated based on the code(ep2d_perf_p2_4mm-0002_affine_masked.nii.gz ep2d_perf_p2_4mm-0002.nii_affine.txt
ep2d_perf_p2_4mm-0002.nii_affine.nii.gz). And I want to use the registration parameters to my rest of imaging. So i used the txt file with the command using Reg_resample(Reg resample - CMIC).

And this is the code ( # Apply transformation
reg_resample -ref $REF_IMG -flo $perf_file -trans $TRANSFORM_FILE -res $OUT_IMG). However, the reg_resample command doesn’t seem to accept the txt files. In this case, which format is needed? Or is there other option in the reg_aladin that generates parameters’ to be used in the Reg_resample?

Thank you!

Hi,

You should be able to use the affine matrix generated by reg_aladin ("${OUTPUT_DIR}/$(basename ${file%..})_affine.txt") as an input to reg_resample.
What error message did you obtain?

You might be using an quite dated version (I need to do a new release, waiting to finalise the GPU re-integration) as it seems reg_resample think your file is a nifti file.
Could you try using the -aff argument instead of -trans?