Commit 47e900f79999ac4e862e7d225df5007508420df8

Authored by Jordi Inglada
1 parent dc926432

BUG: copy input option was wrong

app/iota2FeatureExtraction.cxx
... ... @@ -79,7 +79,7 @@ private:
79 79 "No data value (default = -10000).");
80 80 MandatoryOff("nodata");
81 81  
82   - AddParameter(ParameterType_Empty, "copyinput", "Copy input bands to output image. Default value is true");
  82 + AddParameter(ParameterType_Empty, "copyinput", "Copy input bands to output image (true/false). Default value is false");
83 83 MandatoryOff("copyinput");
84 84  
85 85 AddRAMParameter();
... ... @@ -109,12 +109,13 @@ private:
109 109 auto noDataValue = float{-10000};
110 110 if(IsParameterEnabled("nodata"))
111 111 noDataValue = GetParameterInt("nodata");
112   - auto copyInputBands = true;
  112 + auto copyInputBands = false;
113 113 if (IsParameterEnabled("copyinput"))
114 114 {
115   - copyInputBands = GetParameterEmpty("copyinput");
  115 + copyInputBands = true;
116 116 }
117 117  
  118 + std::cout << "Copy input is " << copyInputBands << "\n";
118 119 FloatVectorImageType::Pointer inputImage = this->GetParameterImage("in");
119 120 inputImage->UpdateOutputInformation();
120 121 auto nbOfInputBands = inputImage->GetNumberOfComponentsPerPixel();
... ...
test/CMakeLists.txt
... ... @@ -38,10 +38,26 @@ otb_test_application(NAME iota2FexApp
38 38 -swir 6
39 39 -indfact 1.0
40 40 -out ${TEMP}/iotaFex.tif
  41 + -copyinput true
41 42 VALID --compare-image ${EPSILON_6}
42 43 ${IOTA2_SOURCE_DIR}/data/AllFeat_D0005H0004.tif
43 44 ${TEMP}/iotaFex.tif)
44 45  
  46 +otb_test_application(NAME iota2FexAppNoCopy
  47 + APP iota2FeatureExtraction
  48 + OPTIONS
  49 + -in ${IOTA2_SOURCE_DIR}/data/D0005H0004_GAP.tif
  50 + -comp 7
  51 + -red 4
  52 + -nir 5
  53 + -swir 6
  54 + -indfact 1.0
  55 + -out ${TEMP}/iotaFexNoCopy.tif
  56 + -copyinput false
  57 + VALID --compare-image ${EPSILON_6}
  58 + ${IOTA2_SOURCE_DIR}/data/OnlyIndices.tif
  59 + ${TEMP}/iotaFexNoCopy.tif)
  60 +
45 61 otb_test_application(NAME iota2FexAppWrongNumbComp
46 62 APP iota2FeatureExtraction
47 63 OPTIONS
... ...