- pydicom
- nibabel
- pandas
- numpy
dcm2niix_HsinChu.py
-
This script is using to convert *.dcm file that come from HsinChu Hospital
-
You might notice that there is no extension name in the raw file, and we also can't read each file directly; fortunately,
dcm2niix.exe
is still working! -
The dictionary from HsinChu be like:
/mnt/HsinChu ├── batch1 <-- the data_root must indicate this location │ ├──S000001 <-- The dictionary at this layer is meaning a patient │ ├──S000010 │ └──...... │ └── batch2 ├── 2023.01-2023.12.... <-- the data_root must indicate this location │ ├── S000001 <-- therefore, this meaining patient │ ├── S000010 │ └── ...... ├── 2024.01-2024.03.... <-- this one also indicate as data_root │ └── ...... └── .....
- The batch1 is already uploaded on doctor's dropbox.
-
The storage structure will same as original
- ex: <the path for patient>/<series number>/<instance uid>/<cardiac phase>/<name generated by dcm2niix.exe>.nii.gz
-
Example:
Follow the example dictionary structure, suppose we want to convert
/mnt/HsinChu/batch2/2023.01-2023.12
, and the target dictionary called/mnt/hsinchu_dst
, thedcm2niix.exe
place at/mnt/lib/dcm2niix.exe
, then we simply namedout
,buf
,err
for output, buffer, error storage dictionary, and using 10 process, the command will look like:python dcm2niix_HsinChu.py --data_root=/mnt/HsinChu/batch2/2023.01-2023.12 --out_dir=/mnt/hsinchu_dst/out --buf_dir=/mnt/hsinchu_dst/buf --err_dir=/mnt/hsinchu_dst/err --num_workers=10 --dcm2niix=/mnt/lib/dcm2niix.exe
-
dcm2niix_Taipei.py
- This script is using to convert *.dcm file that come from Taipei Hospital
- The dictionary from Taipei be like:
- The 502-dicom:
/mnt/usbB/'502-CT(dicom-format) <-- That is for argument --data_root ├── 0001 <-- here are the patient ├── 0003 └── ...... /mnt/usbB/'CCTA Result' <-- That one should pass into --isp_root ├── 0001 # Almost like 502-CT ├── 0003 └── ......
- PS: Because in this part got some chaos
- I already convert around 4 / 5 of raw data(the *.dcm)
- But I just put around 300 patient on doctor's dropbox
- For ignore already processed part, the
--meta_dir
should point to the /mnt/usbA/502CT/meta
- PS: Because in this part got some chaos
- But, for 2500+ dicom, that got different:
/mnt/usbC ├── CGMH <-- That dictionary is for argument --data_root │ ├── 1557.zip <-- I suggest unzip after uploaded, send single file should faster than single dictionary. │ ├── 0003 │ └── ...... ├── CMUH <-- That is for argument --data_root │ ├── 0001 <-- here are the patient │ ├── 0003 │ └── ...... ├── MMH │ └── ...... ├── MMH │ └── ...... ├── ...... └── CT標註result <-- That one is --isp_root
- The 502-dicom:
- The progress
- if the status show Skip ISP it represent the isp folder didn't contain any tissue labels.
python store_each_plq.py ...
python combine_multi_plque.py ...
- The dcm2niix program just download from dcm2niix