Skip to content

Commit d5a4ea0

Browse files
committed
ENH: Set Seeds as conntainer objects
Best practices are to set member variables as object, and not repeat accessor methods in the interface of the owning object e.g. AddSeed, ClearSeed.
1 parent 72f509f commit d5a4ea0

2 files changed

Lines changed: 14 additions & 23 deletions

File tree

Modules/Segmentation/RegionGrowing/include/itkIsolatedConnectedImageFilter.h

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ class ITK_TEMPLATE_EXPORT IsolatedConnectedImageFilter : public ImageToImageFilt
106106
PrintSelf(std::ostream & os, Indent indent) const override;
107107

108108
/** Add seed point 1. This seed will be isolated from Seed2 (if possible).
109-
* All pixels connected to this seed will be replaced with ReplaceValue. */
109+
* All pixels connected to this seed will be replaced with ReplaceValue.
110+
*
111+
* \deprecated Please use SetSeeds1.
112+
*/
110113
void
111114
AddSeed1(const IndexType & seed);
112115

@@ -115,7 +118,7 @@ class ITK_TEMPLATE_EXPORT IsolatedConnectedImageFilter : public ImageToImageFilt
115118
* This seed will be isolated from Seed2 (if possible). All pixels
116119
* connected to this seed will be replaced with ReplaceValue.
117120
*
118-
* \deprecated Please use AddSeed1.
121+
* \deprecated Please use SetSeeds1.
119122
*/
120123
void
121124
SetSeed1(const IndexType & seed);
@@ -124,15 +127,18 @@ class ITK_TEMPLATE_EXPORT IsolatedConnectedImageFilter : public ImageToImageFilt
124127
void
125128
ClearSeeds1();
126129

127-
/** Add seed point 2. This seed will be isolated from Seed1 (if possible). */
130+
/** Add seed point 2. This seed will be isolated from Seed1 (if possible).
131+
*
132+
* \deprecated Please use SetSeed2.
133+
*/
128134
void
129135
AddSeed2(const IndexType & seed);
130136

131137
/** Set a single seed point 2.
132138
*
133139
* This seed will be isolated from Seed1 (if possible).
134140
*
135-
* \deprecated Please use AddSeed2.
141+
* \deprecated Please use SetSeed2.
136142
*/
137143
void
138144
SetSeed2(const IndexType & seed);
@@ -142,10 +148,10 @@ class ITK_TEMPLATE_EXPORT IsolatedConnectedImageFilter : public ImageToImageFilt
142148
ClearSeeds2();
143149

144150
/** Method to access seed container */
145-
virtual const SeedsContainerType &
146-
GetSeeds1() const;
147-
virtual const SeedsContainerType &
148-
GetSeeds2() const;
151+
itkSetMacro(Seeds1, SeedsContainerType);
152+
itkGetConstReferenceMacro(Seeds1, SeedsContainerType);
153+
itkSetMacro(Seeds2, SeedsContainerType);
154+
itkGetConstReferenceMacro(Seeds2, SeedsContainerType);
149155

150156
/** Set/Get the limit on the lower threshold value. The default is
151157
* the NonpositiveMin() for the InputPixelType. */

Modules/Segmentation/RegionGrowing/include/itkIsolatedConnectedImageFilter.hxx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -147,21 +147,6 @@ IsolatedConnectedImageFilter<TInputImage, TOutputImage>::ClearSeeds2()
147147
}
148148
}
149149

150-
template <typename TInputImage, typename TOutputImage>
151-
auto
152-
IsolatedConnectedImageFilter<TInputImage, TOutputImage>::GetSeeds1() const -> const SeedsContainerType &
153-
{
154-
itkDebugMacro("returning Seeds1");
155-
return this->m_Seeds1;
156-
}
157-
158-
template <typename TInputImage, typename TOutputImage>
159-
auto
160-
IsolatedConnectedImageFilter<TInputImage, TOutputImage>::GetSeeds2() const -> const SeedsContainerType &
161-
{
162-
itkDebugMacro("returning Seeds2");
163-
return this->m_Seeds2;
164-
}
165150

166151
template <typename TInputImage, typename TOutputImage>
167152
void

0 commit comments

Comments
 (0)