Probably not the dicom tags if the files load correctly on windows, but maybe something about the file path or permissions. It’s hard to think of any reason two versions of slicer would treat the same dicom files differently.
I have noticed that files are missing when Slicer loads a folder with DICOM content.
I wanted to share this simple script to generate a CSV file to check name by name which files are missing from the list in Slicer:
import pydicom
import sys
import csv
import os
from os import listdir
from os.path import join,isfile
def main():
input_dir = sys.argv[1]
output_file = sys.argv[2]
ds_dict = {
"PatientID": None,
"FileName": None,
"SeriesNumber": None,
"SeriesDescription": None,
"Modality": None}
input_dir = os.path.abspath(input_dir)
with open(output_file, 'a') as f:
w = csv.DictWriter(f, ds_dict.keys())
w.writeheader()
for root, dirs, files in os.walk(input_dir):
for file in files:
file_abspath = os.path.join(input_dir, file)
if file_abspath.endswith('EXTREME'):
try:
ds = pydicom.dcmread(file_abspath, force=True)
ds_dict["FileName"] = str(file)
ds_dict["PatientID"] = str(ds.PatientID)
ds_dict["SeriesNumber"] = str(ds.SeriesNumber)
ds_dict["SeriesDescription"] = str(ds.SeriesDescription)
ds_dict["Modality"] = str(ds.Modality)
w.writerow(ds_dict)
ds_dict = ds_dict.fromkeys(ds_dict, None)
except Exception as ex:
print(str(ex))
continue
f.close()
if __name__ == "__main__":
main()
To run it, just type it in the command line:
python script.py input_folder/ output.csv
The generated CSV file can be opened with any spreadsheet software. By copying the unloaded file to a separate folder and importing it with the “Import DICOM” tool, I can load the missing files one by one.
Do you mean by sharing the DICOM files I use (I should consult it) or with a public example DB? I could get an estimate of what is missing in proportion to those that exist.
What I mean is that it’s not clear if this is an issue with the files or your system of if it’s something to do with Slicer itself. If you are able to provide a set of data and instructions that can be replicated elsewhere it might be possible to get to the heart of the issue.