@@ -49,7 +49,7 @@ def prompt_output_directory(input_dir):
49
49
return os .path .abspath (os .path .join (input_dir , answer .strip ("./" )))
50
50
51
51
52
- def dicom_to_niix (vol_dir : Path , out_dir : Path , merge_2d : bool = False , series_num : int = - 1 , is_single_file : bool = False ):
52
+ def dicom_to_niix (vol_dir : Path , out_dir : Path , merge_2d : bool = False , series_num : int = - 2 , is_single_file : bool = False ):
53
53
"""
54
54
For converting DICOM images to a (compresssed) 4d nifti image
55
55
"""
@@ -66,7 +66,7 @@ def dicom_to_niix(vol_dir: Path, out_dir: Path, merge_2d: bool = False, series_n
66
66
# https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage
67
67
# for further configuration for general usage see page above
68
68
]
69
- if series_num >= 0 :
69
+ if series_num >= - 1 :
70
70
cmd .extend (["-n" , str (series_num )])
71
71
cmd .append (str (vol_dir )) # input directory
72
72
@@ -195,7 +195,7 @@ def run_cli(input_path: str, output_path: str, **kwargs):
195
195
out_dir = Path (output_path )
196
196
197
197
merge_2d = kwargs .get ("merge_2d" , False )
198
- series_num = kwargs .get ("series_number" , - 1 )
198
+ series_num = kwargs .get ("series_number" , - 2 )
199
199
single_file = kwargs .get ("single_file" , False )
200
200
201
201
print (f" Converting:\n → Input: { vol_dir } \n → Output: { out_dir } " )
@@ -220,7 +220,7 @@ def run_cli(input_path: str, output_path: str, **kwargs):
220
220
parser = argparse .ArgumentParser (description = "DICOM to NIfTI converter with optional IVIM processing" )
221
221
parser .add_argument ("input" , nargs = "?" , help = "Path to input DICOM directory" )
222
222
parser .add_argument ("output" , nargs = "?" , help = "Path to output directory for NIfTI files" )
223
- parser .add_argument ("-n" , "--series-number" , type = int , default = - 1 , help = "Only convert this series number (-n <num>)" )
223
+ parser .add_argument ("-n" , "--series-number" , type = int , default = - 2 , help = "Only convert this series number (-n <num>)" )
224
224
parser .add_argument ("-m" , "--merge-2d" , action = "store_true" , help = "Merge 2D slices (-m y)" )
225
225
parser .add_argument ("-s" , "--single-file" , action = "store_true" , help = "Enable single file mode (-s y)" )
226
226
parser .add_argument ("-pu" , "--prompt-user" , action = "store_true" , help = "Run in interactive mode" )
0 commit comments