John, hi!
We have not considered the possibility that the masterinbox
contains soft links to the actual session folders. I put that on our issues list to resolve so the fix should be in a future version.
In regards to a current solution, to provide you with the most accurate advice, can you describe the actual folder structure from which you are importing the data? A snippet of a tree
command output would be most helpful.
Right now, I’ll assume that you have the following folder structure:
<raw data folder>
├─ session1
│ ├─ DICOMs
│ └─ NIfTIs
├─ session2
│ ├─ DICOMs
│ └─ NIfTIs
├─ session3
│ ├─ DICOMs
│ └─ NIfTIs
...
If you set --masterinbox=<raw data folder>
then the content of each session above would be first copied to the corresponding inbox
folder in the QuNex study data structure:
<QuNex study folder>
└─ sessions
├─ session1
│ └─ inbox
│ ├─ DICOMs
│ └─ NIfTIs
├─ session2
│ └─ inbox
│ ├─ DICOMs
│ └─ NIfTIs
...
In the next step a dicom
folder would be created in each session folder and any dicom file found in each inbox
folder would be inspected and moved to a dicom subfolder for that sequence, so you would have:
<QuNex study folder>
└─ sessions
├─ session1
│ ├─ dicom
│ │ ├─ <sequence 1>
│ │ ├─ <sequence 2>
│ │ ├─ <...>
│ │ └─ <sequence N>
│ └─ inbox
│ ├─ DICOMs
│ └─ NIfTIs
...
A dcm2niix
would then be run on each of the sequence folders and the resulting NIfTI files moved to the nii
folder. DICOM-Report.txt
and session.txt
files would also be generated in this step:
<QuNex study folder>
└─ sessions
├─ session1
│ ├─ dicom
│ │ ├─ <sequence 1>
│ │ ├─ <sequence 2>
│ │ ├─ <...>
│ │ ├─ <sequence N>
│ │ └─ DICOM-Report.txt
│ ├─ inbox
│ │ ├─ DICOMs
│ │ └─ NIfTIs
│ ├─ nii
│ │ └─ <sequence 1>.nii.gz
│ │ ├─ <sequence 2>.nii.gz
│ │ ├─ <...>.nii.gz
│ │ └─ <sequence N>.nii.gz
│ └─ session.txt
...
Now, what is most relevant to your question. After successful completion of the conversion to NIfTI step, with --archive=delete
, the whole session[N]
folder in your <raw data folder>
would be deleted. At the same time, any non-dicom file that was copied to <QuNex study folder>/sessions/<session N>/inbox
would remain there. So your NIfTIs
folder with all the content would remain in the inbox
folder. If you no longer need the data that was copied to the inbox
folder, you could then manually (or using a script) delete the content of the inbox
folder.
Writing this up, it seems that it would make sense to add an optional parameter to import_dicom
that would clean up inbox
folders for you on successful completion of import_dicom
.
I hope this helps.