questions > Name output with subfolders names
Showing 1-2 of 2 posts
Display:
Results per page:
Mar 18, 2020  06:03 AM | msignes
Name output with subfolders names
Hello,

I have to convert images that are in different folders (the main folder of each subject has 4 subfolders with different DTI sequences). I would like to convert each of these subfolders and to name the output with the subfolder name. When using the option -f %f what I get is the name of the main folder (but not the name of the subfolders). Is there any solution for that? and to avoid to run the function 4 times, one for each subfolder?

Thank you.
Best,
Mar.
Mar 18, 2020  06:03 AM | Chris Rorden
RE: Name output with subfolders names
You could write a simple wrapper in your favorite scripting language to do this. Just have the script use the folder you want as the %f name in the call to dcm2niix, and run recursively for each of your folders. 

The Github dcm2niix Links section provides a description of a lot of scripts that leverage dcm2niix to organize your data (e.g. generating output in BIDS structure).