MIC-DKFZ / LIDC-IDRI-processing

Scripts for the preprocessing of LIDC-IDRI data
MIT License
75 stars 19 forks source link

ERROR Saving NRRD file #5

Closed ivanwilliammd closed 5 years ago

ivanwilliammd commented 5 years ago

Hello Sir Michael, thank you for answering my latest issue via Git and email and I am sorry to bother you with my problem.

I want to inform you that after adjusting the path_of_dicoms to my CT scan DICOM directory, I got some problem which some of the NRRD files are fragmented such as the figure below and there are no nifty nii.gz file generated. It doesn't show up in error log, and the path of nii.gz are joined together with Characteristics.csv

Figure image

Conversion error log and characteristics csv: conversion_error_log.txt Characteristics.txt

CL command result: Error_dicom_splitted_into_3x3D blocks.txt

The second problem I faced after running some file are Memory Error: Run at: Windows 10, Python 64-bit, 16GB RAM, i7-7700

Traceback (most recent call last):
  File "lidc_data_to_nifti_edited.py", line 388, in <module>
    parse_xml_file(xml_file)
  File "lidc_data_to_nifti_edited.py", line 374, in parse_xml_file
    merge_planar_figures_per_nodule(nrrd_file, patient_id)
  File "lidc_data_to_nifti_edited.py", line 313, in merge_planar_figures_per_nodule
    image=sitk.GetImageFromArray(arrays[key])
  File "C:\Users\Ivan William\AppData\Local\Programs\Python\Python36\lib\site-packages\SimpleITK\SimpleITK.py", line 3446, in GetImageFromArray
    _SimpleITK._SetImageFromArray( z.tostring(), img )
MemoryError

Planar mask folder content: image

  1. Could you please help me point out the main problem of the code and are there any alternative to keeping the integrity of my folder directory so MITKDicomReader won't separate my DICOM folder into 3x3D blocks? *Note: I already confirmed the integrity of DICOM folder by opening it at Aliza and MicroDicom, there are no sudden jump of slice/broken slice (crossed out in Aliza).

  2. Secondly but not the least, how to resolve the memory error?

Thank you Sir Michael @MiGoetz I am eagerly waiting for your answer soon

MiGoetz commented 5 years ago

Could you open the DICOMs with the Graphical Programm delivered with MITK Phenotyping (MITK Workbench)

It might ask you about the Reader that should be used. Could you try out all possible readers? See if there is a reader that gives you only one image as solution.

ivanwilliammd commented 5 years ago

I will try opening the data in MITK Workbench later this night Sir. MicroDicom and Aliza (GUI prpgram) are opening it as single file, but I haven't try to convert it to nrrd file via GUI. I will try and inform you ASAP. Thank you Sir

Note: I already converted my 570 raw dicom data and only 72 succeeded (have whole nrrd and nii.gz), around 50 are nrrd fragmented but still generate nii.gz, and 5 of them are unreadable and forcing the CL to close.

ivanwilliammd commented 5 years ago

Hello Sir Michael, after testing it at MITKWorkbench, the file read as multiple separated 3D blocks.

Aliza and Microdicom only able to open NRRD file, not convert DCM into NRRD

I found out that 3D slicer able to convert DCM in one folder into NRRD. Do you have some reference how to use Slicer Command Line in Windows? Thank you in advance Sir