21 #ifndef otbImageSimulationMethod_hxx
22 #define otbImageSimulationMethod_hxx
29 template <
class TInputVectorData,
class TSpatialisation,
class TSimulationStep1,
class TSimulationStep2,
class TFTM,
class TOutputImage>
33 m_Spatialisation = SpatialisationType::New();
34 m_LabelMapToSimulatedImageFilter = LabelMapToSimulatedImageFilterType::New();
35 m_LabelMapToLabelImageFilter = LabelMapToLabelImageFilterType::New();
46 m_ImageList = ImageListType::New();
47 m_ImageListToVectorImageFilter = ImageListToVectorImageFilterType::New();
50 m_NumberOfComponentsPerPixel = 3;
52 m_SatRSRFilename =
"";
107 template <
class TInputVectorData,
class TSpatialisation,
class TSimulationStep1,
class TSimulationStep2,
class TFTM,
class TOutputImage>
111 return m_ImageListToVectorImageFilter->GetOutput();
115 template <
class TInputVectorData,
class TSpatialisation,
class TSimulationStep1,
class TSimulationStep2,
class TFTM,
class TOutputImage>
119 return m_LabelMapToLabelImageFilter->GetOutput();
122 template <
class TInputVectorData,
class TSpatialisation,
class TSimulationStep1,
class TSimulationStep2,
class TFTM,
class TOutputImage>
125 Superclass::GenerateOutputInformation();
130 m_Spatialisation->UpdateOutputInformation();
132 outputReflImage->SetNumberOfComponentsPerPixel(m_NumberOfComponentsPerPixel);
133 outputReflImage->SetLargestPossibleRegion(m_Spatialisation->GetOutput()->GetLargestPossibleRegion());
134 outputReflImage->SetOrigin(m_Spatialisation->GetOutput()->GetOrigin());
137 outputLabelImage->SetLargestPossibleRegion(m_Spatialisation->GetOutput()->GetLargestPossibleRegion());
138 outputLabelImage->SetOrigin(m_Spatialisation->GetOutput()->GetOrigin());
141 template <
class TInputVectorData,
class TSpatialisation,
class TSimulationStep1,
class TSimulationStep2,
class TFTM,
class TOutputImage>
149 m_LabelMapToSimulatedImageFilter->SetInput(m_Spatialisation->GetOutput());
150 m_LabelMapToSimulatedImageFilter->SetNumberOfComponentsPerPixel(m_NumberOfComponentsPerPixel);
151 m_LabelMapToSimulatedImageFilter->SetSatRSRFilename(m_SatRSRFilename);
152 m_LabelMapToSimulatedImageFilter->SetNumberOfThreads(1);
153 m_LabelMapToSimulatedImageFilter->SetPathRoot(m_PathRoot);
154 m_LabelMapToSimulatedImageFilter->SetMean(m_Mean);
155 m_LabelMapToSimulatedImageFilter->SetVariance(m_Variance);
157 m_LabelMapToLabelImageFilter->SetInput(m_Spatialisation->GetOutput());
159 m_LabelMapToSimulatedImageFilter->UpdateOutputInformation();
161 for (
unsigned int i = 0; i < m_NumberOfComponentsPerPixel; ++i)
168 multiToMonoChannelFilter->SetInput(m_LabelMapToSimulatedImageFilter->GetOutput());
169 multiToMonoChannelFilter->SetChannel(i + 1);
170 multiToMonoChannelFilter->SetExtractionRegion(m_LabelMapToSimulatedImageFilter->GetOutput()->GetLargestPossibleRegion());
173 interpolator->SetInputImage(multiToMonoChannelFilter->GetOutput());
174 interpolator->SetRadius(m_Radius);
175 interpolator->Initialize();
177 multiToMonoChannelFilter->UpdateOutputInformation();
179 FTMFilter->SetInterpolator(interpolator);
181 FTMFilter->SetSize(multiToMonoChannelFilter->GetOutput()->GetLargestPossibleRegion().GetSize());
182 FTMFilter->SetOutputSpacing(multiToMonoChannelFilter->GetOutput()->GetSignedSpacing());
183 FTMFilter->SetOutputOrigin(multiToMonoChannelFilter->GetOutput()->GetOrigin());
184 FTMFilter->SetInput(multiToMonoChannelFilter->GetOutput());
187 m_ImageList->PushBack(FTMFilter->GetOutput());
189 m_ImageListToVectorImageFilter->SetInput(m_ImageList);
258 template <
class TInputVectorData,
class TSpatialisation,
class TSimulationStep1,
class TSimulationStep2,
class TFTM,
class TOutputImage>
260 itk::Indent indent)
const
262 Superclass::PrintSelf(os, indent);