I have a folder with multiple sub-folders and files. They are all similar in name but the only difference is the patient's number
Example
Analysis/Patient_01/Brain/image_patient_01_merged.nii
Analysis/Patient_02/Brain/image_patient_02_merged.nii
Analysis/Patient_03/Brain/image_patient_03_merged.nii
.
.
.
and so on.
In the main folder (Analysis
) I want to make a script to do the same thing for each .nii
file in a loop.
example
fslstats image_patient_01_merged.nii -M
fslstats image_patient_02_merged.nii -M
fslstats image_patient_03_merged.nii -M
.
.
.
.
In other words, I need to do the same analysis on the nii files in each subdirectory.
image_patient_01_merged.nii crop_patient_01_original.nii segmented_patient_01_new.nii . . . and so on. I only need to do the analysis for the image_patient_01_merged.nii file only in each patient directory and not to all .nii files
– Ali Radaideh Nov 22 '17 at 12:12