Skip to content

Commit 5e47bcc

Browse files
committed
STYLE: Let signature of MakeOutput member functions match with ITK
Fixed the parameter type of the `MakeOutput` member functions of ImageSamplerBase, VectorContainerSource, and MultiResolutionImageRegistrationMethod2, to ensure that they properly override ITK's `ProcessObject::MakeOutput(DataObjectPointerArraySizeType)`. Following ITK commit InsightSoftwareConsortium/ITK@b066b36 "COMP: Fix VisualStudio warning int possible loss of data.", Matt McCormick, 2011-11-17, by using `DataObjectPointerArraySizeType`.
1 parent b207c56 commit 5e47bcc

File tree

6 files changed

+10
-8
lines changed

6 files changed

+10
-8
lines changed

Common/ImageSamplers/itkImageSamplerBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class ITK_TEMPLATE_EXPORT ImageSamplerBase
8989

9090
/** Create a valid output. */
9191
DataObject::Pointer
92-
MakeOutput(unsigned int idx) override;
92+
MakeOutput(ProcessObject::DataObjectPointerArraySizeType idx) override;
9393

9494
/** Set the input image of this process object. */
9595
void

Common/ImageSamplers/itkImageSamplerBase.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ ImageSamplerBase<TInputImage>::ImageSamplerBase()
420420

421421
template <class TInputImage>
422422
DataObject::Pointer
423-
ImageSamplerBase<TInputImage>::MakeOutput(unsigned int itkNotUsed(idx))
423+
ImageSamplerBase<TInputImage>::MakeOutput(ProcessObject::DataObjectPointerArraySizeType itkNotUsed(idx))
424424
{
425425
OutputVectorContainerPointer outputVectorContainer = OutputVectorContainerType::New();
426426
return outputVectorContainer.GetPointer();

Common/ImageSamplers/itkVectorContainerSource.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ class ITK_TEMPLATE_EXPORT VectorContainerSource : public ProcessObject
6868
GraftNthOutput(unsigned int idx, DataObject * output);
6969

7070
/** Make a DataObject of the correct type to used as the specified output. */
71-
virtual DataObjectPointer
72-
MakeOutput(unsigned int idx);
71+
DataObjectPointer
72+
MakeOutput(ProcessObject::DataObjectPointerArraySizeType idx) override;
7373

7474
protected:
7575
/** The constructor. */

Common/ImageSamplers/itkVectorContainerSource.hxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ VectorContainerSource<TOutputVectorContainer>::VectorContainerSource()
4949

5050
template <class TOutputVectorContainer>
5151
auto
52-
VectorContainerSource<TOutputVectorContainer>::MakeOutput(unsigned int itkNotUsed(idx)) -> DataObjectPointer
52+
VectorContainerSource<TOutputVectorContainer>::MakeOutput(ProcessObject::DataObjectPointerArraySizeType itkNotUsed(idx))
53+
-> DataObjectPointer
5354
{
5455
return static_cast<DataObject *>(TOutputVectorContainer::New().GetPointer());
5556
} // end MakeOutput()

Common/itkMultiResolutionImageRegistrationMethod2.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ class ITK_TEMPLATE_EXPORT MultiResolutionImageRegistrationMethod2 : public Proce
233233
/** Make a DataObject of the correct type to be used as the specified
234234
* output.
235235
*/
236-
virtual DataObjectPointer
237-
MakeOutput(unsigned int idx);
236+
DataObjectPointer
237+
MakeOutput(ProcessObject::DataObjectPointerArraySizeType idx) override;
238238

239239
/** Method to return the latest modified time of this object or
240240
* any of its cached ivars.

Common/itkMultiResolutionImageRegistrationMethod2.hxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,8 @@ MultiResolutionImageRegistrationMethod2<TFixedImage, TMovingImage>::GetOutput()
458458

459459
template <typename TFixedImage, typename TMovingImage>
460460
DataObject::Pointer
461-
MultiResolutionImageRegistrationMethod2<TFixedImage, TMovingImage>::MakeOutput(unsigned int output)
461+
MultiResolutionImageRegistrationMethod2<TFixedImage, TMovingImage>::MakeOutput(
462+
ProcessObject::DataObjectPointerArraySizeType output)
462463
{
463464
if (output > 0)
464465
{

0 commit comments

Comments
 (0)