From 15e0f3df7902cdf1af4a8adfea696a70e084ac80 Mon Sep 17 00:00:00 2001 From: David Sarrut Date: Mon, 25 Jul 2011 10:28:01 +0200 Subject: [PATCH] Add clitkImage2DicomRTStruct executable to convert a binary image into a dicom-rt struct --- tools/clitkImage2DicomRTStruct.cxx | 46 ++++++++++++++++++++++++++++++ tools/clitkImage2DicomRTStruct.ggo | 20 +++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 tools/clitkImage2DicomRTStruct.cxx create mode 100644 tools/clitkImage2DicomRTStruct.ggo diff --git a/tools/clitkImage2DicomRTStruct.cxx b/tools/clitkImage2DicomRTStruct.cxx new file mode 100644 index 0000000..e48272c --- /dev/null +++ b/tools/clitkImage2DicomRTStruct.cxx @@ -0,0 +1,46 @@ +/*========================================================================= + Program: vv http://www.creatis.insa-lyon.fr/rio/vv + Main authors : XX XX XX + + Authors belongs to: + - University of LYON http://www.universite-lyon.fr/ + - Léon Bérard cancer center http://www.centreleonberard.fr + - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the copyright notices for more information. + + It is distributed under dual licence + - BSD http://www.opensource.org/licenses/bsd-license.php + - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html + + =========================================================================*/ + +#include "clitkImage2DicomRTStructFilter.h" +#include "clitkDicomRT_StructureSet.h" +#include "clitkImage2DicomRTStruct_ggo.h" + +//-------------------------------------------------------------------- +int main(int argc, char * argv[]) { + + // Init command line + GGO(clitkImage2DicomRTStruct, args_info); + + // Read initial 3D image + typedef float PixelType; + typedef itk::Image ImageType; + ImageType::Pointer input = clitk::readImage(args_info.input_arg, true); + + // Create a filter to convert image into dicomRTStruct + clitk::Image2DicomRTStructFilter filter; + filter.SetInput(input); + filter.Update(); + + // Write result + clitk::DicomRT_StructureSet::Pointer s = filter.GetDicomRTStruct(); + s->Write(args_info.output_arg); + + // This is the end my friend + return 0; +} diff --git a/tools/clitkImage2DicomRTStruct.ggo b/tools/clitkImage2DicomRTStruct.ggo new file mode 100644 index 0000000..68334b1 --- /dev/null +++ b/tools/clitkImage2DicomRTStruct.ggo @@ -0,0 +1,20 @@ +# file clitkImage2DicomRTStruct.ggo +package "clitk" +version "Convert (binary) image to DICOM RT Structure Set (contours)" + +option "config" - "Config file" string no +option "verbose" v "Verbose" flag off + +option "input" i "Input image file (binary image" string yes +option "output" o "Output DicomRT filename" string yes + + +# option "image" j "Used to read image info (spacing, origin)" string yes +# option "roi" r "ROI to binarize (if -1 = all roi)" int no default="-1" + +# option "crop" c "Crop binary mask" flag off + +#option "roi" r "ROI to print (ID)" int no +#option "contour" c "contour to print (ID)" int no +#option "offset" o "to display points as image offsets" flag off + -- 2.47.1