Closed annehaley closed 2 years ago
so I can see already one issue that is
"0": {
"file_location": "/fs/storage/XNAT/archive/duke_incoming/arc001/C-70183-F-1-20220407/RESOURCES/nifti/7_ncanda-dti6b500pepolar-v1/image5.nii.gz"
},
"1": {
"file_location": "/fs/storage/XNAT/archive/duke_incoming/arc001/C-70183-F-1-20220407/RESOURCES/nifti/7_ncanda-dti6b500pepolar-v1/image6.nii.gz"
},
"2": {
"file_location": "/fs/storage/XNAT/archive/duke_incoming/arc001/C-70183-F-1-20220407/RESOURCES/nifti/7_ncanda-dti6b500pepolar-v1/image7.nii.gz"
},
"3": {
"file_location": "/fs/storage/XNAT/archive/duke_incoming/arc001/C-70183-F-1-20220407/RESOURCES/nifti/7_ncanda-dti6b500pepolar-v1/image8.nii.gz"
},
"4": {
"file_location": "/fs/storage/XNAT/archive/duke_incoming/arc001/C-70183-F-1-20220407/RESOURCES/nifti/7_ncanda-dti6b500pepolar-v1/image1.nii.gz"
},
"5": {
"file_location": "/fs/storage/XNAT/archive/duke_incoming/arc001/C-70183-F-1-20220407/RESOURCES/nifti/7_ncanda-dti6b500pepolar-v1/image3.nii.gz"
},
"6": {
"file_location": "/fs/storage/XNAT/archive/duke_incoming/arc001/C-70183-F-1-20220407/RESOURCES/nifti/7_ncanda-dti6b500pepolar-v1/image4.nii.gz"
},
"7": {
"file_location": "/fs/storage/XNAT/archive/duke_incoming/arc001/C-70183-F-1-20220407/RESOURCES/nifti/7_ncanda-dti6b500pepolar-v1/image2.nii.gz"
}
the frames are not in the right order e.g. frame 7 is image2 instead of image8
also what about the other sequences that have multiple images such as ncanda-dti60b1000-v1 @annehaley
Ok, I can make the ordering explicitly alphabetical. Good catch. Change made in 2ca9fd2.
As for the other folders that contain more than one file, they will also have mutliple frames. In my example, I only copied the structure of the one directory you sent me, so only the one scan has multiple frames. The function looks at the contents of each scan folder.
@annehaley ok - can you please provide me the updated output with the latest commit
@annehaley ok - can you please provide me the updated output with the latest commit
I updated the description above - it includes the updated output
The first commit adds an argument
project_list
ot the commandwrite_miqa_import_file
. If there is data found for any project not included in this list argument, an exception will be raised and the file will not be written. If there is no data found for a project included in this list argument, this project will get an empty dataset in the import file and the file will be successfully written. When this file is used in a global import in MIQA, those empty projects will have their contents cleared.The second commit changes the behavior of the
convert_dataframe_to_new_format
function such that scan directories with more than one image file will have each image file written as a frame within the same scan. Due to this directory-scanning behavior, frames will not be written for files that do not exist.Below is an example usage:
The input csv file, using the old MIQA import format:
The output json file:
OR the output CSV file: