From d647919fe732d73ed24138daaec16080c00df892 Mon Sep 17 00:00:00 2001 From: tbaudier Date: Fri, 11 Jan 2019 11:55:04 +0100 Subject: [PATCH] Remove extract_series option With the itk::GDCMSeriesFileNames, we automatically have the dicom sorted according series, so this option is not necessary anymore. So I removed the option in the .ggo file and I remove the if conditions. I add .c_str() to series_UID to remove trailling white spaces --- tools/clitkDicom2Image.cxx | 12 ++++-------- tools/clitkDicom2Image.ggo | 3 +-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/tools/clitkDicom2Image.cxx b/tools/clitkDicom2Image.cxx index 54ab6bd..066aaf8 100644 --- a/tools/clitkDicom2Image.cxx +++ b/tools/clitkDicom2Image.cxx @@ -93,11 +93,9 @@ int main(int argc, char * argv[]) hreader.Read(); gdcm::DataSet& ds = hreader.GetFile().GetDataSet(); - if (args_info.extract_series_flag) { - gdcm::Attribute<0x20,0x000e> series_UID_att; - series_UID_att.SetFromDataSet(ds); - series_UID = series_UID_att.GetValue(); - } + gdcm::Attribute<0x20,0x000e> series_UID_att; + series_UID_att.SetFromDataSet(ds); + series_UID = series_UID_att.GetValue().c_str(); series_UIDs.insert(series_UID); theorigin[series_UID] = gdcm::ImageHelper::GetOriginValue(hreader.GetFile()); @@ -132,9 +130,7 @@ int main(int argc, char * argv[]) header->SetMaxSizeLoadEntry(16384); // required ? header->Load(); - if (args_info.extract_series_flag) { - series_UID = header->GetEntryValue(0x20,0x000e).c_str(); - } + series_UID = header->GetEntryValue(0x20,0x000e).c_str(); series_UIDs.insert(series_UID); theorigin[series_UID].resize(3); diff --git a/tools/clitkDicom2Image.ggo b/tools/clitkDicom2Image.ggo index 7cf454f..fd678f9 100644 --- a/tools/clitkDicom2Image.ggo +++ b/tools/clitkDicom2Image.ggo @@ -1,6 +1,6 @@ # file clitkDicom2Image.ggo package "clitk" -version "Try to convert a DICOM into an image (.hdr, .vox...)" +version "Try to convert a DICOM into an image (.hdr, .vox...) identifying all available series" option "config" - "Config file" string no option "verbose" v "Verbose" flag off @@ -8,5 +8,4 @@ option "tolerance" t "Tolerance for slice position" double default="0" no option "output" o "Output image filename" string yes option "std_input" - "Take the like of input file from stdin, to support huge lists of filenames" flag off option "focal_origin" - "Output files with FOCAL-like origin, instead of the origin present in the dicom files" flag off -option "extract_series" s "Identify different series in the file list and create the MHDs accordinly" flag off option "patientSystem" p "Open the image with patient coordinate system" flag off -- 2.45.0