From: tbaudier Date: Thu, 28 Feb 2019 13:07:52 +0000 (+0100) Subject: Add reverse flag in clitkDicom2Image X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=a384b1aa2ad35011b2741fca00a2a52e26b30e8f;p=clitk.git Add reverse flag in clitkDicom2Image Sometimes (eg: with MR from HEH), the basic algorithm is not sufficient to sort dicom slices The sorting reverse the slice order --- diff --git a/tools/clitkDicom2Image.cxx b/tools/clitkDicom2Image.cxx index e705f85..614c5d9 100644 --- a/tools/clitkDicom2Image.cxx +++ b/tools/clitkDicom2Image.cxx @@ -246,6 +246,11 @@ int main(int argc, char * argv[]) } } + //=========================================== + // Reverse the slice order (for MR from HEH) + if (args_info.reverse_flag) + std::reverse(sorted_files.begin(), sorted_files.end()); + //=========================================== // Read write serie vvImageReader::Pointer reader = vvImageReader::New(); diff --git a/tools/clitkDicom2Image.ggo b/tools/clitkDicom2Image.ggo index 049ff98..8563d46 100644 --- a/tools/clitkDicom2Image.ggo +++ b/tools/clitkDicom2Image.ggo @@ -10,3 +10,4 @@ option "std_input" - "Take the like of input file from stdin, to support hu option "focal_origin" - "Output files with FOCAL-like origin, instead of the origin present in the dicom files" flag off option "patientSystem" p "Open the image with patient coordinate system" flag off option "instanceNumber" n "Sort the images regarding instance number in dicom tag" flag off +option "reverse" r "Reverse the slice order" flag off