how to write Dimon output files into gert_outdir

Hi Rick,

I can’t seem to figure out how to get the reconstructed output file from Dimon to be written into the folder specified in ‘gert_outdir’.

Here is my script:

Dimon -infile_prefix SS22_Structural/e177/s1547/i
-gert_outdir SS22_Structural/Flair
-gert_to3d_prefix Flair.nii.gz

I run this script in a parent directory (Structural_Scans) that contains the folder SS22_Structural. I am expecting it to create a directory in SS22_Structural called “Flair” and put the output of Dimon in that new directory. It creates the Flair directory in the correct place but it empty. Whatever I try it always writes the files to the current directory (Strucrural_Scans). I get an error at the end of the code that says “mv: No match”. I am thinking that the last step where it moves the data is not working for some reason.

Warm regards,

This is the Dimon command I use. It correctly leaves the HEAD/BRIK files in the -gert_outdir. You may want to play around with the -GERT_Reco -gert_create_dataset commands and their location on the command.

Dimon -infile_pattern $sdir/‘*.IMA’ -dicom_org -gert_filename make.$ntask
-save_file_list “${subject}.${ntask}.dicom.list”
-gert_to3d_prefix “${subject}.${ntask}” -gert_outdir ${session}
-GERT_Reco -gert_create_dataset -quit

Hi Christine,

Just to add to Colm’s good example, there are 2 things that go wrong in your example, though Dimon could be updated to handle them.

One is that the GERT_Reco scripts use a simple ‘mkdir’ command to make directories. If intermediate directories are needed, that would fail. It can be updated to include the -p option.

The other is specifying a NIFTI prefix is not reconciled with outdir and -gert_write_as_nifti.

I will fix both of those things and run a new build tonight.


  • rick

Hi Christine,

Updates for that are available, as of AFNI version AFNI_18.3.16.


  • rick