Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import os
import re
import shutil
import subprocess
import tempfile
import pydicom
Expand All @@ -25,6 +26,8 @@ def convert(dcm_files, nifti_file=None, converted_files_location="/tmp/upload"):

with tempfile.TemporaryDirectory() as temp_dir:
for dcm_file in dcm_files:
# Copy DICOM file into temp_dir so dcm2niix can process it
shutil.copy2(dcm_file, temp_dir)

ds = pydicom.dcmread(dcm_file)
series_number_tag = ds.get((0x0020, 0x0011), None)
Expand Down