Compare View

switch
from
...
to
 
Commits (3)
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();
... ...
data/AllFeat_D0005H0004.tif 0 → 100755
No preview for this file type
data/D0005H0004_GAP.tif 0 → 100755
No preview for this file type
data/OnlyIndices.tif 0 → 100644
No preview for this file type
include/iota2FeatureExtraction.h
... ... @@ -76,7 +76,7 @@ public:
76 76 {
77 77 m_NumberOfDates = m_NumberOfInputComponents/m_ComponentsPerDate;
78 78 m_NumberOfOutputComponents = (m_NumberOfFeatures +
79   - m_ComponentsPerDate)*m_NumberOfDates;
  79 + (cpi?m_ComponentsPerDate:0))*m_NumberOfDates;
80 80 auto max_index_band = std::max({m_RedIndex, m_NIRIndex, m_SWIRIndex});
81 81 if(max_index_band > m_ComponentsPerDate)
82 82 throw std::domain_error("Band indices and components per date are not coherent.");
... ...
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
... ...