]> Creatis software - clitk.git/commitdiff
Add --mha tag in clitkDicomRTStruct2Image to allow structure with special characters...
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Fri, 8 Jul 2016 11:21:05 +0000 (13:21 +0200)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Fri, 8 Jul 2016 11:21:05 +0000 (13:21 +0200)
tools/clitkDicomRTStruct2Image.cxx
tools/clitkDicomRTStruct2Image.ggo

index 04564a016f4e63a55f9a717378ee8bfa2cec9a66..302f65ced9ed72ec44964b0650b4e5b01c480832 100644 (file)
@@ -68,11 +68,21 @@ int main(int argc, char * argv[]) {
         filter.SetCropMaskEnabled(args_info.crop_flag);
         filter.SetImageFilename(args_info.image_arg);  // Used to get spacing + origin
         name.erase(remove_if(name.begin(), name.end(), isspace), name.end());
-        std::string n = std::string(args_info.output_arg).append
-          (clitk::toString(num)).append
-          ("_").append
-          (name).append
-          (".mhd");
+        std::string n;
+        if (args_info.mha_flag) {
+          n = std::string(args_info.output_arg).append
+            (clitk::toString(num)).append
+            ("_").append
+            (name).append
+            (".mha");
+        }
+        else {
+          n = std::string(args_info.output_arg).append
+            (clitk::toString(num)).append
+            ("_").append
+            (name).append
+            (".mhd");
+        }
         if (args_info.verbose_flag) {
           std::cout << num << " " << roi->GetName() << " num=" << num << " : " << n << std::endl;
         }
index 8a09da1c5b4baa33a2e915d3eb303ae5a48c4e3c..980f8a92bcba6322586a158c0f4a8da3d5d695cc 100644 (file)
@@ -16,6 +16,8 @@ groupoption "roiNameSubstr"     s "Substring of ROI name to binarize (reuturns a
 
 option "crop"           c "Crop binary mask"            flag off
 
+option "mha"  - "Write the RTStruct as a mha image to avoid special character problems"                 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