ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkBSplineScatteredDataPointSetToImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkBSplineScatteredDataPointSetToImageFilter_h
19#define itkBSplineScatteredDataPointSetToImageFilter_h
20
22
25#include "itkVectorContainer.h"
26
27#include "vnl/vnl_matrix.h"
28
29namespace itk
30{
123
124template <typename TInputPointSet, typename TOutputImage>
126 : public PointSetToImageFilter<TInputPointSet, TOutputImage>
127{
128public:
129 ITK_DISALLOW_COPY_AND_MOVE(BSplineScatteredDataPointSetToImageFilter);
130
136
138 itkNewMacro(Self);
139
141 itkOverrideGetNameOfClassMacro(BSplineScatteredDataPointSetToImageFilter);
142
144 static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
145
146 using ImageType = TOutputImage;
147 using PointSetType = TInputPointSet;
148
150 using PixelType = typename ImageType::PixelType;
151 using RegionType = typename ImageType::RegionType;
153 using SizeType = typename ImageType::SizeType;
154 using IndexType = typename ImageType::IndexType;
155
157 using PointType = typename PointSetType::PointType;
158 using PointSetPointer = typename PointSetType::Pointer;
159 using PointDataType = typename PointSetType::PixelType;
160 using PointDataContainerType = typename PointSetType::PointDataContainer;
161 using PointDataContainerPointer = typename PointDataContainerType::Pointer;
162
164 using RealType = float;
166
174
181
182
187 void
188 SetSplineOrder(unsigned int);
189
193 void
195
199 itkGetConstReferenceMacro(SplineOrder, ArrayType);
200
205 itkSetMacro(NumberOfControlPoints, ArrayType);
206 itkGetConstReferenceMacro(NumberOfControlPoints, ArrayType);
208
213 itkGetConstReferenceMacro(CurrentNumberOfControlPoints, ArrayType);
214
219 void
220 SetNumberOfLevels(unsigned int);
221
226 void
228
233 itkGetConstReferenceMacro(NumberOfLevels, ArrayType);
234
241 itkSetMacro(BSplineEpsilon, RealType);
242 itkGetConstMacro(BSplineEpsilon, RealType);
244
261 itkSetMacro(CloseDimension, ArrayType);
262 itkGetConstReferenceMacro(CloseDimension, ArrayType);
264
267 void
269
273 itkSetMacro(GenerateOutputImage, bool);
274 itkGetConstReferenceMacro(GenerateOutputImage, bool);
275 itkBooleanMacro(GenerateOutputImage);
277
281 {
282 return static_cast<PointDataImageType *>(this->ProcessObject::GetOutput(1));
283 }
284
285protected:
288
289 void
290 PrintSelf(std::ostream & os, Indent indent) const override;
291
292 void
294
295 void
297 {
298 itkExceptionMacro("This class requires threadId so it must use classic multi-threading model");
299 }
300
301 void
303
304 void
306
307 unsigned int
308 SplitRequestedRegion(unsigned int, unsigned int, RegionType &) override;
309
310 void
311 GenerateData() override;
312
313private:
316 void
318
321 void
323
325 void
327
329 void
331
333 void
335
338 void
340
343 void
345
349 NumberToIndex(const unsigned int, const SizeType);
350
351 bool m_DoMultilevel{ false };
353 bool m_UsePointWeights{ false };
354 unsigned int m_MaximumNumberOfLevels{ 1 };
355 unsigned int m_CurrentLevel{ 0 };
361
363
366
368
370
372
377
378 std::vector<RealImagePointer> m_OmegaLatticePerThread{};
379 std::vector<PointDataImagePointer> m_DeltaLatticePerThread{};
380
381 RealType m_BSplineEpsilon{ static_cast<RealType>(1e-3) };
382 bool m_IsFittingComplete{ false };
384};
385} // end namespace itk
386
387#ifndef ITK_MANUAL_INSTANTIATION
388# include "itkBSplineScatteredDataPointSetToImageFilter.hxx"
389#endif
390
391#endif
BSpline kernel used for density estimation and nonparametric regression.
void ThreadedGenerateDataForReconstruction(const RegionType &, ThreadIdType)
void PrintSelf(std::ostream &os, Indent indent) const override
IndexType NumberToIndex(const unsigned int, const SizeType)
void SetPointWeights(WeightsContainerType *weights)
unsigned int SplitRequestedRegion(unsigned int, unsigned int, RegionType &) override
void ThreadedGenerateDataForUpdatingResidualValues(const RegionType &, ThreadIdType)
void CollapsePhiLattice(PointDataImageType *, PointDataImageType *, const RealType, const unsigned int)
~BSplineScatteredDataPointSetToImageFilter() override=default
PointSetToImageFilter< TInputPointSet, TOutputImage > Superclass
void ThreadedGenerateDataForFitting(const RegionType &, ThreadIdType)
void ThreadedGenerateData(const RegionType &, ThreadIdType) override
BSpline kernel used for density estimation and nonparametric regression.
Simulate a standard C array with copy semantics.
Templated n-dimensional image class.
Definition itkImage.h:89
Control indentation during Print() invocation.
Definition itkIndent.h:50
DataObject * GetOutput(const DataObjectIdentifierType &key)
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int ThreadIdType
detail::VectorContainer< std::conditional_t< std::is_void_v< T2 >, SizeValueType, T1 >, std::conditional_t< std::is_void_v< T2 >, T1, T2 > > VectorContainer