I am trying to run a transformation with the Advanced Normalization Tool (ANTs), however I keep getting the same error message, no matter how I modify the code.
Could you please help and assist me in this matter?
I am using terminal zsh.
I tried several ways of using the square brackets, #, and curly bracket, ”, and “” – but I keep receiving the error message. Even-though the out0GenericAffine.mat files are existing in the given folder, and the path was clearly defined previously.
Commands to reproduce the problem:
antsApplyTransforms -d 3 -i "$ROI_mask" -r "$b0brain"
-t "$T1_folder"/b0_T1/out0GenericAffine.mat [1]
-t "$T1_folder"/out0GenericAffine.mat [1]
-t "$T1_folder/out1InverseWarp.nii.gz"
-n NearestNeighbor -o "$T1_folder/new_mask_dir/${filename_mask}_in_T2.nii.gz" -v
Output of the command with verbose output:
~ % antsApplyTransforms -d 3 -i "$ROI_mask" -r "$b0brain"
-t "$T1_folder"/b0_T1/out0GenericAffine.mat [1]
-t "$T1_folder"/out0GenericAffine.mat'[1]'
-t "$T1_folder/out1InverseWarp.nii.gz"
-n NearestNeighbor -o "$T1_folder/new_mask_dir/${filename_mask}_in_T2.nii.gz" -v
Using double precision for computations.
Input scalar image: /Users/anneliesvantwesteinde/precuneus/precuneus_ROI_Left.nii.gz
Reference image: /Volumes/Diana/Preprocessed/DTI/Addison_AllControls/ADDI_013/nodif.nii.gz
Transform file does not exist: 1
Can't read initial transform 1
(This was the original code I tried first:)
antsApplyTransforms -d 3 -i "$ROI_mask" -r $b0brain -t ["$T1_folder"/b0_T1/out0GenericAffine.mat,1] -t ["$T1_folder"/T1_MNI/out0GenericAffine.mat,1] -t "$T1_folder"/T1_MNI/out1InverseWarp.nii.gz -n NearestNeighbor -o "$new_mask_dir"/$filename_mask/"$filename_mask"_in_T2.nii.gz -v
The out0GenericAffine.mat files are existing in the given folder, and the paths were clearly defined.
I am trying to register and then applying 3 images to the same space.
within this code I tried indicating that the transformation is being applied to the first column of the transformation matrix [“$T1_folder”/b0_T1/out0GenericAffine.mat,1]
However the terminal does not seem to recognize this and keep receiving the error code mentioned above.
I use: Operating system and version
macOS-14.0
CPU architecture
arm64 (Apple M1/M2)
user24833735 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.