lamyj / dicomifier

A medical image converter
https://dicomifier.readthedocs.io/
Other
30 stars 7 forks source link

to-nifti can't merge nifti stacks #51

Open Microdeep-ZL opened 1 year ago

Microdeep-ZL commented 1 year ago

version: 2.3.1 platform: Ubuntu-22.04 (WSL2)

Instead of generating a single nitfi file for the dicom foler, it generated 80 small nifti files and 80 json files, each pair corresponding to one slice in the dicom folder. On the other hand, dicomifier worked normally on the dicom folder from another project.

By dicomifier nii -v debug input_dir output_dir, I found that both the successful and unsuccessful cases had no error or warning message. The only difference is that the unsuccessful case didn't merge the 80 stacks. Please advise what I can do to solve the problem. Thanks!!

The unsuccessful case debug messages are as follows (DICOMDIR is 7/pdata/1/dicom):

(dicomifier) fengh@IMC-CPL-429S9K3:/mnt/c/Users/fengh/Desktop/dicomifer$ dicomifier nii -v debug 7 7again111
INFO - dicomifier: Splitting 80 DICOM files in series
INFO - dicomifier: 1 series found
INFO - dicomifier: Reading 80 DICOM files
INFO - dicomifier: mrmdSajiWT01 / iv01 / 7:1-acq-TurboRARE_T2w: Found 80 stacks
DEBUG - dicomifier: mrmdSajiWT01 / iv01 / 7:1-acq-TurboRARE_T2w: Converting stack 1/80
DEBUG - dicomifier: mrmdSajiWT01 / iv01 / 7:1-acq-TurboRARE_T2w: dtype set to: <class 'numpy.float32'>
DEBUG - dicomifier: mrmdSajiWT01 / iv01 / 7:1-acq-TurboRARE_T2w: Converting stack 2/80
DEBUG - dicomifier: mrmdSajiWT01 / iv01 / 7:1-acq-TurboRARE_T2w: dtype set to: <class 'numpy.float32'>
...
DEBUG - dicomifier: mrmdSajiWT01 / iv01 / 7:1-acq-TurboRARE_T2w: Converting stack 80/80
DEBUG - dicomifier: mrmdSajiWT01 / iv01 / 7:1-acq-TurboRARE_T2w: dtype set to: <class 'numpy.float32'>

The successful case debug messages are as follows (DICOMDIR is dicom):

(dicomifier) fengh@IMC-CPL-429S9K3:/mnt/c/Users/fengh/Desktop/dicomifer$ dicomifier nii -v debug dicom dicomagain111
INFO - dicomifier: Splitting 2100 DICOM files in series
INFO - dicomifier: 1 series found
INFO - dicomifier: Reading 2100 DICOM files
INFO - dicomifier: mrmdDREADD363 / ev01 / 18:1-DtiStandard_TR400_FA90_1AVG_30Dir_ISO_250_1000b: Found 35 stacks
DEBUG - dicomifier: mrmdDREADD363 / ev01 / 18:1-DtiStandard_TR400_FA90_1AVG_30Dir_ISO_250_1000b: Converting stack 1/35
DEBUG - dicomifier: mrmdDREADD363 / ev01 / 18:1-DtiStandard_TR400_FA90_1AVG_30Dir_ISO_250_1000b: dtype set to: <class 'numpy.float32'>
...
DEBUG - dicomifier: mrmdDREADD363 / ev01 / 18:1-DtiStandard_TR400_FA90_1AVG_30Dir_ISO_250_1000b: Converting stack 35/35
DEBUG - dicomifier: mrmdDREADD363 / ev01 / 18:1-DtiStandard_TR400_FA90_1AVG_30Dir_ISO_250_1000b: dtype set to: <class 'numpy.float32'>
INFO - dicomifier: mrmdDREADD363 / ev01 / 18:1-DtiStandard_TR400_FA90_1AVG_30Dir_ISO_250_1000b: Merging 35 stacks