Skip to content

Commit a5b1d17

Browse files
committed
BUG: Expose OutputMeshType * GetOutput(index)
1 parent 4427e06 commit a5b1d17

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

include/itkCleaverImageToMeshFilter.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ class CleaverImageToMeshFilter : public ImageToMeshFilter<TInputImage, TOutputMe
5353
using Pointer = SmartPointer<Self>;
5454
using ConstPointer = SmartPointer<const Self>;
5555

56+
using DataObjectPointerArraySizeType = typename Superclass::Superclass::DataObjectPointerArraySizeType;
57+
5658
/** Run-time type information. */
5759
itkTypeMacro(CleaverImageToMeshFilter, ImageToMeshFilter);
5860

@@ -86,14 +88,19 @@ class CleaverImageToMeshFilter : public ImageToMeshFilter<TInputImage, TOutputMe
8688
itkSetMacro(FeatureScaling, double);
8789
itkGetConstMacro(FeatureScaling, double);
8890

89-
/** Sizing field padding. Adds a volume buffer around the data. Useful when volumes intersect near the boundary. */
91+
/** Sizing field padding. Adds a volume buffer around the data. Useful when volumes intersect near the boundary. */
9092
itkSetMacro(Padding, int);
9193
itkGetConstMacro(Padding, int);
9294

9395
itkSetMacro(Alpha, double);
9496
itkGetConstMacro(Alpha, double);
9597

96-
using Superclass::Superclass::GetOutput;
98+
/** Get the outptu meshes. Output 0 is the tetrahedral mesh. Output 1 is the
99+
* interface triangle mesh. */
100+
OutputMeshType *
101+
GetOutput(DataObjectPointerArraySizeType index);
102+
const OutputMeshType *
103+
GetOutput(DataObjectPointerArraySizeType index) const;
97104

98105
protected:
99106
CleaverImageToMeshFilter();

include/itkCleaverImageToMeshFilter.hxx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ segmentationToIndicatorFunctions(const TImage * image, double sigma) {
6666
auto caster = CasterType::New();
6767
caster->SetInput(image);
6868
caster->Update();
69-
69+
7070
//determine the number of labels in the segmentations
7171
using ImageCalculatorFilterType = itk::MinimumMaximumImageCalculator<FloatImageType>;
7272
auto imageCalculatorFilter
@@ -180,7 +180,7 @@ imagesToCleaverFloatFields(std::vector<const TImage *> images, double sigma)
180180
{
181181
std::vector<cleaver::AbstractScalarField*> fields;
182182
size_t num = 0;
183-
for (auto image : images)
183+
for (auto image : images)
184184
{
185185
using ImageType = TImage;
186186
using FloatImageType = itk::Image<float, ImageType::ImageDimension>;
@@ -321,6 +321,22 @@ CleaverImageToMeshFilter<TInputImage, TOutputMesh>
321321
}
322322

323323

324+
template <typename TInputImage, typename TOutputMesh>
325+
auto
326+
CleaverImageToMeshFilter<TInputImage, TOutputMesh>
327+
::GetOutput(DataObjectPointerArraySizeType index) -> OutputMeshType *
328+
{
329+
return static_cast<OutputMeshType *>(this->ProcessObject::GetOutput(index));
330+
}
331+
332+
template <typename TInputImage, typename TOutputMesh>
333+
auto
334+
CleaverImageToMeshFilter<TInputImage, TOutputMesh>
335+
::GetOutput(DataObjectPointerArraySizeType index) const -> const OutputMeshType *
336+
{
337+
return static_cast<const OutputMeshType *>(this->ProcessObject::GetOutput(index));
338+
}
339+
324340
template <typename TInputImage, typename TOutputMesh>
325341
void
326342
CleaverImageToMeshFilter<TInputImage, TOutputMesh>
@@ -482,7 +498,7 @@ CleaverImageToMeshFilter<TInputImage, TOutputMesh>
482498
}
483499
}
484500

485-
OutputMeshType * tetOutput = this->GetOutput(0);
501+
OutputMeshType * tetOutput = this->GetOutput(0);
486502
using CellType = typename OutputMeshType::CellType;
487503

488504
for (size_t ii = 0; ii < prunedVerts.size(); ii++)
@@ -526,7 +542,7 @@ CleaverImageToMeshFilter<TInputImage, TOutputMesh>
526542
tetOutput->SetCellData(outputCellData);
527543

528544

529-
OutputMeshType * triangleOutput = this->GetOutput(1);
545+
OutputMeshType * triangleOutput = this->GetOutput(1);
530546

531547
std::vector<size_t> interfaces;
532548
std::vector<size_t> triangleCellData;

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
1414
name='itk-cleaver',
15-
version='1.1.0',
15+
version='1.1.1',
1616
author='SCI Institute',
1717
author_email='itk+community@discourse.itk.org',
1818
packages=['itk'],

0 commit comments

Comments
 (0)