Anonymous Dicom file failed to import in Dicom module

i have a series of anonymous dicom files, when i try to import it; dicom module shows loading process but after it patient , study,series data shows 0(zero) value.so i cant load that series successfully.
there is any different way to load anonymous series or any limitations on dicom series.
(i have also tried to patch the series , which is also failed to patch)

Thanks,

Please follow the steps described here and let us know if you need further help.

1 Like

Can you please tell me the thing actually slicer looks into series to catch the data or series info which helps it to identify the series as a volume data and loads it successfully( i mean as an anonymous series which dicom tag is important to load the series successfully) , so i can keep that thing while converting my series to anonymous.

Anonymization of DICOM data is a complex topic - you should try to use a standard tool like CTP or DicomCleaner (linked from the FAQ posted earlier) and the needed context is likely to be preserved.

If you want to know what header fields Slicer uses, you can start here with the code but there’s a lot of detail and we rely on many packages (ITK, CTK, DCMTK, GDCM…).

1 Like

When you create DICOM series, it is important to comply to DICOM standard to set all mandatory fields and not just fulfill one particular application’s requirements. Unfortunately, it is very difficult to decipher from the DICOM standard what fields are those, as there are many conditions and often even medical device manufacturers make mistakes (for example non-clinical, micro-CT, cone-beam CT devices are notoriously bad). That’s why I is recommended to use those standard anonymization tools that @pieper described above.

1 Like

thanks @lassoan And @pieper
I’ll look into this.

Hello Andras i have looked into this series , the thing is when i try to import the series after loading the series this window showup
Capture

and in python interactor it shows: - Imported a DICOM directory, checking for extensions

and after trying to patch this series in DICOMPatcher following erros message :

Traceback (most recent call last):
  File "C:/Program Files/Slicer 4.9.0/lib/Slicer-4.9/qt-scripted-modules/DICOMPatcher.py", line 154, in onPatchButton
    self.logic.patchDicomDir(self.inputDirSelector.currentPath, self.outputDirSelector.currentPath)
  File "C:/Program Files/Slicer 4.9.0/lib/Slicer-4.9/qt-scripted-modules/DICOMPatcher.py", line 577, in patchDicomDir
    dicom.write_file(patchedFilePath, ds)
  File "C:\Program Files\Slicer 4.9.0\lib\Python\Lib\site-packages\dicom\filewriter.py", line 356, in write_file
    write_dataset(fp, dataset)
  File "C:\Program Files\Slicer 4.9.0\lib\Python\Lib\site-packages\dicom\filewriter.py", line 200, in write_dataset
    write_data_element(fp, dataset[tag], dataset_encoding)
  File "C:\Program Files\Slicer 4.9.0\lib\Python\Lib\contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "C:\Program Files\Slicer 4.9.0\lib\Python\Lib\site-packages\dicom\tagtools.py", line 21, in tag_in_exception
    raise type(e)(err)
Traceback (most recent call last):
  File "C:/Program Files/Slicer 4.9.0/lib/Slicer-4.9/qt-scripted-modules/DICOMPatcher.py", line 159, in onPatchButton
    traceback.print_exc()
  File "C:/Program Files/Slicer 4.9.0/lib/Python/Lib\traceback.py", line 233, in print_exc
    print_exception(etype, value, tb, limit, file)
  File "C:/Program Files/Slicer 4.9.0/lib/Python/Lib\traceback.py", line 128, in print_exception
    _print(file, line, '')
  File "C:/Program Files/Slicer 4.9.0/lib/Python/Lib\traceback.py", line 13, in _print
    file.write(str+terminator)
TypeError: argument 1 must be string without null bytes, not str![Capture|192x159]

Does it any kind of bug in Dicom or DICOMPatcher module.

It seems there is an invalid tag in the DICOM file. It is probably a string with the value of “[Capture|192x159]” which is incorrectly zero-terminated. If you have access to the software that created the DICOM tag then probably you can fix it by not writing the terminating \0 character to the DICOM file.

1 Like