From 87226f434fbe4cb47dbbef889b8b6e8279efb983 Mon Sep 17 00:00:00 2001 From: pierre gueth Date: Tue, 8 Nov 2011 11:17:55 +0100 Subject: [PATCH] added target image translation in gamma index --- tools/clitkGammaIndex.cxx | 12 ++++++++++++ tools/clitkGammaIndex.ggo | 3 +++ 2 files changed, 15 insertions(+) diff --git a/tools/clitkGammaIndex.cxx b/tools/clitkGammaIndex.cxx index be0f807..7e5a92e 100644 --- a/tools/clitkGammaIndex.cxx +++ b/tools/clitkGammaIndex.cxx @@ -224,6 +224,17 @@ int main(int argc,char * argv[]) // load reference vtkImageData* reference = loadImage(reference_filename); assert(reference); + + // translate target with arguments values + // reference is translated instead of target so that the output space stay the same as target + { + double reference_origin[3]; + reference->GetOrigin(reference_origin); + reference_origin[0] -= args_info.translation_x_arg; + reference_origin[1] -= args_info.translation_y_arg; + reference_origin[2] -= args_info.translation_z_arg; + reference->SetOrigin(reference_origin); + } // intensity normalisation if (!use_dose_margin) { @@ -246,6 +257,7 @@ int main(int argc,char * argv[]) vtkImageData* target = loadImage(target_filename); assert(target); + // allocate output OutputImageType::Pointer output = OutputImageType::New(); { diff --git a/tools/clitkGammaIndex.ggo b/tools/clitkGammaIndex.ggo index 20c87f9..b41ba75 100644 --- a/tools/clitkGammaIndex.ggo +++ b/tools/clitkGammaIndex.ggo @@ -12,4 +12,7 @@ option "output" o "Output image filename" string yes option "spatial-margin" s "Spatial margin [mm]" double yes option "relative-dose-margin" r "Dose margin relative to max dose in reference [%]" double no option "absolute-dose-margin" d "Absolute dose margin [Gray]" double no +option "translation-x" x "Target relative position x [mm]" double default="0" no +option "translation-y" y "Target relative position y [mm]" double default="0" no +option "translation-z" z "Target relative position z [mm]" double default="0" no -- 2.45.1