CMakeLists.txt 6.39 KB
Newer Older
Jordi Inglada's avatar
Jordi Inglada committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
#
#  Examples on the use of Iterators.
#
PROJECT(IteratorExamples)
INCLUDE_REGULAR_EXPRESSION("^.*$")

ADD_EXECUTABLE(ImageRandomConstIteratorWithIndex ImageRandomConstIteratorWithIndex.cxx)
TARGET_LINK_LIBRARIES(ImageRandomConstIteratorWithIndex OTBIO OTBCommon ITKIO   )

ADD_EXECUTABLE(NeighborhoodIterators4 NeighborhoodIterators4.cxx)
TARGET_LINK_LIBRARIES(NeighborhoodIterators4 OTBIO OTBCommon ITKIO   )

ADD_EXECUTABLE(NeighborhoodIterators5 NeighborhoodIterators5.cxx)
TARGET_LINK_LIBRARIES(NeighborhoodIterators5 OTBIO OTBCommon ITKIO   )

IF(NOT BORLAND)
ADD_EXECUTABLE(NeighborhoodIterators1 NeighborhoodIterators1.cxx)
TARGET_LINK_LIBRARIES(NeighborhoodIterators1 OTBIO OTBCommon ITKIO   )

ADD_EXECUTABLE(NeighborhoodIterators2 NeighborhoodIterators2.cxx)
TARGET_LINK_LIBRARIES(NeighborhoodIterators2 OTBIO OTBCommon ITKIO   )

ADD_EXECUTABLE(NeighborhoodIterators3 NeighborhoodIterators3.cxx)
TARGET_LINK_LIBRARIES(NeighborhoodIterators3 OTBIO OTBCommon ITKIO   )

ADD_EXECUTABLE(NeighborhoodIterators6 NeighborhoodIterators6.cxx)
27
TARGET_LINK_LIBRARIES(NeighborhoodIterators6 ITKAlgorithms ITKBasicFilters OTBIO OTBCommon ITKIO ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
Jordi Inglada's avatar
Jordi Inglada committed
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54

ADD_EXECUTABLE(ImageRegionIteratorWithIndex ImageRegionIteratorWithIndex.cxx)
TARGET_LINK_LIBRARIES(ImageRegionIteratorWithIndex OTBIO OTBCommon ITKIO   )

ADD_EXECUTABLE(ImageRegionIterator ImageRegionIterator.cxx)
TARGET_LINK_LIBRARIES(ImageRegionIterator OTBIO OTBCommon ITKIO   )

ADD_EXECUTABLE(ImageLinearIteratorWithIndex2 ImageLinearIteratorWithIndex2.cxx)
TARGET_LINK_LIBRARIES(ImageLinearIteratorWithIndex2 OTBIO OTBCommon ITKIO   )

ADD_EXECUTABLE(ImageLinearIteratorWithIndex ImageLinearIteratorWithIndex.cxx)
TARGET_LINK_LIBRARIES(ImageLinearIteratorWithIndex OTBIO OTBCommon ITKIO   )

ADD_EXECUTABLE(ImageSliceIteratorWithIndex ImageSliceIteratorWithIndex.cxx)
TARGET_LINK_LIBRARIES(ImageSliceIteratorWithIndex OTBIO OTBCommon ITKIO   )

ADD_EXECUTABLE(ShapedNeighborhoodIterators1 ShapedNeighborhoodIterators1.cxx)
TARGET_LINK_LIBRARIES(ShapedNeighborhoodIterators1 ITKAlgorithms ITKBasicFilters OTBIO OTBCommon ITKIO )

ADD_EXECUTABLE(ShapedNeighborhoodIterators2 ShapedNeighborhoodIterators2.cxx)
TARGET_LINK_LIBRARIES(ShapedNeighborhoodIterators2 ITKAlgorithms ITKBasicFilters OTBIO OTBCommon ITKIO )

ADD_EXECUTABLE(IteratorsExamples IteratorsExamples.cxx )
TARGET_LINK_LIBRARIES(IteratorsExamples OTBIO OTBCommon ITKIO ITKBasicFilters )

ENDIF(NOT BORLAND)

Julien Michel's avatar
Julien Michel committed
55

56
IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
Julien Michel's avatar
Julien Michel committed
57 58 59

SET(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/Iterators)

60
SET(INPUTDATA ${OTB_DATA_ROOT}/Examples)
Julien Michel's avatar
Julien Michel committed
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
SET(TEMP ${OTB_BINARY_DIR}/Testing/Temporary)

SET(EXE_TESTS ${CXX_TEST_PATH}/otbIteratorsExamplesTests)

SET(TOL 0.0)


# ------- ImageRegionIteratorWithIndexTest----------

ADD_TEST(ImageRegionIteratorWithIndexTest ${EXE_TESTS}
	--compare-n-images ${TOL} 1
	${BASELINE}/ImageRegionIteratorWithIndexOutput.png
	${TEMP}/ImageRegionIteratorWithIndexOutput.png
	ImageRegionIteratorWithIndexTest
	${INPUTDATA}/ROI_QB_MUL_2.tif
	${TEMP}/ImageRegionIteratorWithIndexOutput.png
)

# ------- NeighborhoodIterators1Test----------

ADD_TEST(NeighborhoodIterators1Test ${EXE_TESTS}
	--compare-n-images ${TOL} 1
	${BASELINE}/NeighborhoodIterators1a.png
	${TEMP}/NeighborhoodIterators1a.png
	NeighborhoodIterators1Test
	${INPUTDATA}/ROI_QB_PAN_1.tif
	${TEMP}/NeighborhoodIterators1a.png
)

# ------- NeighborhoodIterators4Test----------

ADD_TEST(NeighborhoodIterators4Test ${EXE_TESTS}
	--compare-n-images ${TOL} 1
	${BASELINE}/NeighborhoodIterators4a.png
	${TEMP}/NeighborhoodIterators4a.png
	NeighborhoodIterators4Test
	${INPUTDATA}/QB_Suburb.png
	${TEMP}/NeighborhoodIterators4a.png
    0
)

# ------- NeighborhoodIterators4Test----------

ADD_TEST(NeighborhoodIterators4Test ${EXE_TESTS}
	--compare-n-images ${TOL} 1
	${BASELINE}/NeighborhoodIterators4b.png
	${TEMP}/NeighborhoodIterators4b.png
	NeighborhoodIterators4Test
	${INPUTDATA}/QB_Suburb.png
	${TEMP}/NeighborhoodIterators4b.png
    1
)

# ------- NeighborhoodIterators4Test----------

ADD_TEST(NeighborhoodIterators4Test ${EXE_TESTS}
	--compare-n-images ${TOL} 1
	${BASELINE}/NeighborhoodIterators4c.png
	${TEMP}/NeighborhoodIterators4c.png
	NeighborhoodIterators4Test
	${INPUTDATA}/QB_Suburb.png
	${TEMP}/NeighborhoodIterators4c.png
    2
)

# ------- NeighborhoodIterators4Test----------

ADD_TEST(NeighborhoodIterators4Test ${EXE_TESTS}
	--compare-n-images ${TOL} 1
	${BASELINE}/NeighborhoodIterators4d.png
	${TEMP}/NeighborhoodIterators4d.png
	NeighborhoodIterators4Test
	${INPUTDATA}/QB_Suburb.png
	${TEMP}/NeighborhoodIterators4d.png
    5
)

# ------- NeighborhoodIterators6Test----------

ADD_TEST(NeighborhoodIterators6Test ${EXE_TESTS}
	--compare-n-images ${TOL} 1
	${BASELINE}/NeighborhoodIterators6a.png
	${TEMP}/NeighborhoodIterators6a.png
	NeighborhoodIterators6Test
	${TEMP}/NeighborhoodIterators6a.png
    100 100
)

# ------- NeighborhoodIterators6Test----------

ADD_TEST(NeighborhoodIterators6Test ${EXE_TESTS}
	--compare-n-images ${TOL} 1
	${BASELINE}/NeighborhoodIterators6b.png
	${TEMP}/NeighborhoodIterators6b.png
	NeighborhoodIterators6Test
	${TEMP}/NeighborhoodIterators6b.png
    50 150
)

# ------- NeighborhoodIterators6Test----------

ADD_TEST(NeighborhoodIterators6Test ${EXE_TESTS}
	--compare-n-images ${TOL} 1
	${BASELINE}/NeighborhoodIterators6c.png
	${TEMP}/NeighborhoodIterators6c.png
	NeighborhoodIterators6Test
	${TEMP}/NeighborhoodIterators6c.png
    150 50
)

# ------- ImageRegionIteratorTest----------

ADD_TEST(ImageRegionIteratorTest ${EXE_TESTS}
	--compare-n-images ${TOL} 1
	${BASELINE}/ImageRegionIteratorOutput.png
	${TEMP}/ImageRegionIteratorOutput.png
	ImageRegionIteratorTest
	${INPUTDATA}/QB_Suburb.png
	${TEMP}/ImageRegionIteratorOutput.png
     10 10 110 140
)

# ------- ShapedNeighborhoodIterators2Test----------

ADD_TEST(ShapedNeighborhoodIterators2Test ${EXE_TESTS}
	--compare-n-images ${TOL} 1
	${BASELINE}/ShapedNeighborhoodIterators1b.png
	${TEMP}/ShapedNeighborhoodIterators1b.png
	ShapedNeighborhoodIterators2Test
	${INPUTDATA}/BinaryImage.png
	${TEMP}/ShapedNeighborhoodIterators1b.png
  4
)


ADD_EXECUTABLE(otbIteratorsExamplesTests otbIteratorsExamplesTests.cxx)
197
TARGET_LINK_LIBRARIES(otbIteratorsExamplesTests ${GDAL_LIBRARY} ITKIO ITKAlgorithms ITKStatistics ITKCommon OTBBasicFilters OTBCommon OTBDisparityMap OTBIO OTBSpatialReasoning OTBChangeDetection OTBFeatureExtraction  OTBLearning  OTBMultiScale ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES})
Julien Michel's avatar
Julien Michel committed
198

199
ENDIF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )