Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Main Repositories
otb
Commits
1f671be8
Commit
1f671be8
authored
Jun 27, 2019
by
Cédric Traizet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
REFAC: remove SpatialObjects module
parent
e60455a2
Pipeline
#2028
passed with stages
in 54 minutes and 18 seconds
Changes
27
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
0 additions
and
2882 deletions
+0
-2882
Data/Baseline/OTB/Images/bfTvSpatialObjectDrawingNoInput.png
Data/Baseline/OTB/Images/bfTvSpatialObjectDrawingNoInput.png
+0
-3
Data/Baseline/OTB/Images/bfTvSpatialObjectDrawingNoInput.png.aux.xml
...ne/OTB/Images/bfTvSpatialObjectDrawingNoInput.png.aux.xml
+0
-3
Modules/Core/SpatialObjects/CMakeLists.txt
Modules/Core/SpatialObjects/CMakeLists.txt
+0
-23
Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectFilter.h
...e/SpatialObjects/include/otbDrawLineSpatialObjectFilter.h
+0
-124
Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectFilter.hxx
...SpatialObjects/include/otbDrawLineSpatialObjectFilter.hxx
+0
-103
Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.h
...atialObjects/include/otbDrawLineSpatialObjectListFilter.h
+0
-138
Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.hxx
...ialObjects/include/otbDrawLineSpatialObjectListFilter.hxx
+0
-342
Modules/Core/SpatialObjects/include/otbImageToLineSpatialObjectListFilter.h
...alObjects/include/otbImageToLineSpatialObjectListFilter.h
+0
-103
Modules/Core/SpatialObjects/include/otbImageToLineSpatialObjectListFilter.hxx
...Objects/include/otbImageToLineSpatialObjectListFilter.hxx
+0
-92
Modules/Core/SpatialObjects/include/otbLineSpatialObject.h
Modules/Core/SpatialObjects/include/otbLineSpatialObject.h
+0
-138
Modules/Core/SpatialObjects/include/otbLineSpatialObject.hxx
Modules/Core/SpatialObjects/include/otbLineSpatialObject.hxx
+0
-291
Modules/Core/SpatialObjects/include/otbLineSpatialObjectList.h
...es/Core/SpatialObjects/include/otbLineSpatialObjectList.h
+0
-71
Modules/Core/SpatialObjects/include/otbLineSpatialObjectListToPointSetFilter.h
...bjects/include/otbLineSpatialObjectListToPointSetFilter.h
+0
-92
Modules/Core/SpatialObjects/include/otbLineSpatialObjectListToPointSetFilter.hxx
...ects/include/otbLineSpatialObjectListToPointSetFilter.hxx
+0
-92
Modules/Core/SpatialObjects/include/otbSpatialObjectSource.h
Modules/Core/SpatialObjects/include/otbSpatialObjectSource.h
+0
-85
Modules/Core/SpatialObjects/include/otbSpatialObjectSource.hxx
...es/Core/SpatialObjects/include/otbSpatialObjectSource.hxx
+0
-64
Modules/Core/SpatialObjects/include/otbSpatialObjectToImageDrawingFilter.h
...ialObjects/include/otbSpatialObjectToImageDrawingFilter.h
+0
-169
Modules/Core/SpatialObjects/include/otbSpatialObjectToImageDrawingFilter.hxx
...lObjects/include/otbSpatialObjectToImageDrawingFilter.hxx
+0
-474
Modules/Core/SpatialObjects/otb-module.cmake
Modules/Core/SpatialObjects/otb-module.cmake
+0
-43
Modules/Core/SpatialObjects/test/CMakeLists.txt
Modules/Core/SpatialObjects/test/CMakeLists.txt
+0
-59
Modules/Core/SpatialObjects/test/otbDrawLineSpatialObject.cxx
...les/Core/SpatialObjects/test/otbDrawLineSpatialObject.cxx
+0
-89
Modules/Core/SpatialObjects/test/otbDrawLineSpatialObjectList.cxx
...Core/SpatialObjects/test/otbDrawLineSpatialObjectList.cxx
+0
-139
Modules/Core/SpatialObjects/test/otbLineSpatialObjectList.cxx
...les/Core/SpatialObjects/test/otbLineSpatialObjectList.cxx
+0
-51
Modules/Core/SpatialObjects/test/otbSpatialObjectToImageDrawingFilter.cxx
...tialObjects/test/otbSpatialObjectToImageDrawingFilter.cxx
+0
-63
Modules/Core/SpatialObjects/test/otbSpatialObjectsTestDriver.cxx
.../Core/SpatialObjects/test/otbSpatialObjectsTestDriver.cxx
+0
-29
Modules/Feature/Corner/otb-module.cmake
Modules/Feature/Corner/otb-module.cmake
+0
-1
Modules/Feature/Edge/otb-module.cmake
Modules/Feature/Edge/otb-module.cmake
+0
-1
No files found.
Data/Baseline/OTB/Images/bfTvSpatialObjectDrawingNoInput.png
deleted
100644 → 0
LFS
View file @
e60455a2
128 Bytes
Data/Baseline/OTB/Images/bfTvSpatialObjectDrawingNoInput.png.aux.xml
deleted
100644 → 0
View file @
e60455a2
<PAMDataset>
<GeoTransform>
-1.0050000000000000e+02, 1.0000000000000000e+00, 0.0000000000000000e+00, -5.0500000000000000e+01, 0.0000000000000000e+00, 1.0000000000000000e+00
</GeoTransform>
</PAMDataset>
Modules/Core/SpatialObjects/CMakeLists.txt
deleted
100644 → 0
View file @
e60455a2
#
# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
# https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
project
(
OTBSpatialObjects
)
otb_module_impl
()
Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectFilter.h
deleted
100644 → 0
View file @
e60455a2
/*
* Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbDrawLineSpatialObjectFilter_h
#define otbDrawLineSpatialObjectFilter_h
#include "itkSpatialObjectToImageFilter.h"
#include "otbDrawLineSpatialObjectListFilter.h"
//#include <list>
namespace
otb
{
/** \class DrawLineSpatialObjectFilter
* \brief Application of a filter which draw line in a binary image.
*
* This class implements a filter that draws line in a binary image.
* Inputs are a LineSpatialObject and an input image that is used to
* allocate the output image. This filter copies the input image in
* the output image.
*
*
* \ingroup OTBSpatialObjects
*/
template
<
class
TInputImage
,
class
TOutputImage
>
class
ITK_EXPORT
DrawLineSpatialObjectFilter
:
//public itk::SpatialObjectToImageFilter< itk::LineSpatialObject<2>, TOutputImage >
public
itk
::
ImageToImageFilter
<
TInputImage
,
TOutputImage
>
{
public:
/** Extract dimensions as well of the images of entry of exit. */
itkStaticConstMacro
(
InputImageDimension
,
unsigned
int
,
TInputImage
::
ImageDimension
);
itkStaticConstMacro
(
OutputImageDimension
,
unsigned
int
,
TOutputImage
::
ImageDimension
);
/** typedef for the classes standards. */
typedef
DrawLineSpatialObjectFilter
Self
;
//typedef itk::ImageTo< itk::LineSpatialObject<2>, TOutputImage > Superclass;
typedef
itk
::
ImageToImageFilter
<
TInputImage
,
TOutputImage
>
Superclass
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
/** Method for management of the "object factory". */
itkNewMacro
(
Self
);
/** Return the name of the class. */
itkTypeMacro
(
DrawLineSpatialObjectFilter
,
/*SpatialObjectToImageFilter*/
itk
::
ImageToImageFilter
);
/** typedef Support for input & output image*/
typedef
TInputImage
InputImageType
;
typedef
TOutputImage
OutputImageType
;
typedef
typename
OutputImageType
::
PixelType
OutputPixelType
;
/** Support typedef for input & Output*/
typedef
itk
::
LineSpatialObject
<
2
>
InputLineType
;
typedef
itk
::
ProcessObject
ProcessObjectType
;
/** Typedef Support for lineList Type*/
typedef
LineSpatialObjectList
LineSpatialObjectListType
;
typedef
typename
LineSpatialObjectListType
::
Pointer
LineSpatialObjectListPointer
;
/** Typedef Support for drawLineSpatialObjectListFilter*/
typedef
otb
::
DrawLineSpatialObjectListFilter
<
InputImageType
,
OutputImageType
>
DrawLineSpatialObjectListFilterType
;
typedef
typename
DrawLineSpatialObjectListFilterType
::
Pointer
DrawLineSpatialObjectListFilterPointerType
;
/** Set/Get the image input of this process object. */
/* virtual void SetInputImage(const InputImageType *image); */
/* const InputImageType * GetInputImage(void); */
/** Get the input LineSpatialObjet (not const) */
virtual
void
SetInputLine
(
const
InputLineType
*
line
);
InputLineType
*
GetInputLine
(
void
);
/** Set/Get pixel value */
itkSetMacro
(
Value
,
OutputPixelType
);
itkGetConstReferenceMacro
(
Value
,
OutputPixelType
);
protected:
DrawLineSpatialObjectFilter
();
~
DrawLineSpatialObjectFilter
()
override
{}
void
PrintSelf
(
std
::
ostream
&
os
,
itk
::
Indent
indent
)
const
override
;
void
GenerateData
()
override
;
private:
DrawLineSpatialObjectFilter
(
const
Self
&
)
=
delete
;
void
operator
=
(
const
Self
&
)
=
delete
;
OutputPixelType
m_Value
;
DrawLineSpatialObjectListFilterPointerType
m_DrawLineListFilter
;
};
}
// end namespace otb
#ifndef OTB_MANUAL_INSTANTIATION
#include "otbDrawLineSpatialObjectFilter.hxx"
#endif
#endif
Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectFilter.hxx
deleted
100644 → 0
View file @
e60455a2
/*
* Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbDrawLineSpatialObjectFilter_hxx
#define otbDrawLineSpatialObjectFilter_hxx
#include "otbDrawLineSpatialObjectFilter.h"
#include "itkDataObject.h"
#include "itkMacro.h"
#include "itkImageRegionIterator.h"
#include "itkImageIteratorWithIndex.h"
namespace
otb
{
/**
*
*/
template
<
class
TInputImage
,
class
TOutputImage
>
DrawLineSpatialObjectFilter
<
TInputImage
,
TOutputImage
>::
DrawLineSpatialObjectFilter
()
{
this
->
SetNumberOfRequiredInputs
(
2
);
this
->
SetNumberOfRequiredOutputs
(
1
);
m_Value
=
static_cast
<
OutputPixelType
>
(
255.0
);
m_DrawLineListFilter
=
DrawLineSpatialObjectListFilterType
::
New
();
}
template
<
class
TInputImage
,
class
TOutputImage
>
void
DrawLineSpatialObjectFilter
<
TInputImage
,
TOutputImage
>
::
SetInputLine
(
const
InputLineType
*
line
)
{
this
->
ProcessObjectType
::
SetNthInput
(
1
,
const_cast
<
InputLineType
*>
(
line
));
}
template
<
class
TInputImage
,
class
TOutputImage
>
typename
DrawLineSpatialObjectFilter
<
TInputImage
,
TOutputImage
>::
InputLineType
*
DrawLineSpatialObjectFilter
<
TInputImage
,
TOutputImage
>
::
GetInputLine
(
void
)
{
return
static_cast
<
InputLineType
*>
(
this
->
ProcessObjectType
::
GetInput
(
1
));
}
template
<
class
TInputImage
,
class
TOutputImage
>
void
DrawLineSpatialObjectFilter
<
TInputImage
,
TOutputImage
>
::
GenerateData
(
void
)
{
typename
InputImageType
::
ConstPointer
input
=
this
->
GetInput
();
InputLineType
*
line
=
this
->
GetInputLine
();
typename
OutputImageType
::
Pointer
output
=
this
->
GetOutput
();
/** Create a new list line with one line*/
LineSpatialObjectListPointer
lineList
=
LineSpatialObjectListType
::
New
();
lineList
->
push_back
(
line
);
/** Invoke the DrawLineSpatialObjectListFilter to draw the line */
m_DrawLineListFilter
->
SetInput
(
input
);
m_DrawLineListFilter
->
SetInputLineSpatialObjectList
(
lineList
);
m_DrawLineListFilter
->
GraftOutput
(
this
->
GetOutput
());
m_DrawLineListFilter
->
Update
();
this
->
GraftOutput
(
m_DrawLineListFilter
->
GetOutput
());
}
/**
* Standard "PrintSelf" method
*/
template
<
class
TInputImage
,
class
TOutput
>
void
DrawLineSpatialObjectFilter
<
TInputImage
,
TOutput
>::
PrintSelf
(
std
::
ostream
&
os
,
itk
::
Indent
indent
)
const
{
Superclass
::
PrintSelf
(
os
,
indent
);
os
<<
indent
<<
"Path Value: "
<<
m_Value
<<
std
::
endl
;
}
}
// end namespace otb
#endif
Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.h
deleted
100644 → 0
View file @
e60455a2
/*
* Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbDrawLineSpatialObjectListFilter_h
#define otbDrawLineSpatialObjectListFilter_h
#include "itkImageToImageFilter.h"
#include "otbLineSpatialObjectList.h"
namespace
otb
{
/** \class DrawLineSpatialObjectListFilter
* \brief Composite filter which draw lines in an image.
*
* This class implements a composite filter that draws a list of lines in
* an input Image. This class
*
*
*
*
* \ingroup OTBSpatialObjects
*/
template
<
class
TInputImage
,
class
TOutputImage
>
class
ITK_EXPORT
DrawLineSpatialObjectListFilter
:
public
itk
::
ImageToImageFilter
<
TInputImage
,
TOutputImage
>
{
public:
/** Extract dimensions as well of the images of entry of exit. */
itkStaticConstMacro
(
InputImageDimension
,
unsigned
int
,
TInputImage
::
ImageDimension
);
itkStaticConstMacro
(
OutputImageDimension
,
unsigned
int
,
TOutputImage
::
ImageDimension
);
/** typedefs support for inputs & outputs*/
typedef
TInputImage
InputImageType
;
typedef
TOutputImage
OutputImageType
;
typedef
typename
OutputImageType
::
RegionType
OutputImageRegionType
;
/** typedef for the classes standards. */
typedef
DrawLineSpatialObjectListFilter
Self
;
typedef
itk
::
ImageToImageFilter
<
TInputImage
,
TOutputImage
>
Superclass
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
typedef
LineSpatialObjectList
LinesListType
;
typedef
LinesListType
::
LineType
LineType
;
typedef
LineType
::
PointListType
PointListType
;
typedef
typename
LinesListType
::
const_iterator
LineListIterator
;
typedef
itk
::
ProcessObject
ProcessObjectType
;
/** Method for management of the "object factory". */
itkNewMacro
(
Self
);
/** Return the name of the class. */
itkTypeMacro
(
DrawLineSpatialObjectListFilter
,
ImageToImageFilter
);
/** Definition of the input and output images */
typedef
typename
InputImageType
::
PixelType
InputPixelType
;
typedef
typename
OutputImageType
::
PixelType
OutputPixelType
;
typedef
typename
OutputImageType
::
IndexType
OutputIndexType
;
typedef
typename
OutputIndexType
::
IndexValueType
OutputIndexValueType
;
/** Set/Get the image input of this process object. */
virtual
void
SetInputLineSpatialObjectList
(
const
LinesListType
*
list
);
LinesListType
*
GetInputLineSpatialObjectList
(
void
);
/** Get/Set m_Value*/
itkGetMacro
(
Value
,
OutputPixelType
);
itkSetMacro
(
Value
,
OutputPixelType
);
protected:
DrawLineSpatialObjectListFilter
();
~
DrawLineSpatialObjectListFilter
()
override
{}
void
PrintSelf
(
std
::
ostream
&
os
,
itk
::
Indent
indent
)
const
override
;
void
ThreadedGenerateData
(
const
OutputImageRegionType
&
outputRegionForThread
,
itk
::
ThreadIdType
threadId
)
override
;
/**
* compute the intersection of the segment to draw with the region
*/
virtual
void
CropSegment
(
OutputIndexType
*
indexToCrop
,
OutputIndexType
*
otherIndex
,
const
OutputImageRegionType
*
outputRegionForThread
)
const
;
virtual
void
CropRightSegment
(
OutputIndexType
*
indexToCrop
,
OutputIndexType
*
otherIndex
,
const
OutputImageRegionType
*
outputRegionForThread
)
const
;
virtual
bool
IsUpsideTheRegion
(
OutputIndexType
*
indexToCrop
,
const
OutputImageRegionType
*
outputRegionForThread
)
const
;
virtual
bool
IsDownsideTheRegion
(
OutputIndexType
*
indexToCrop
,
const
OutputImageRegionType
*
outputRegionForThread
)
const
;
virtual
bool
IsDownsideTheImage
(
OutputIndexType
*
indexToCrop
)
const
;
virtual
bool
IsColumnOutsideOfTheRegion
(
OutputIndexType
*
indexToCheck
,
OutputIndexType
*
otherToCheck
,
const
OutputImageRegionType
*
outputRegionForThread
)
const
;
private:
DrawLineSpatialObjectListFilter
(
const
Self
&
)
=
delete
;
void
operator
=
(
const
Self
&
)
=
delete
;
OutputPixelType
m_Value
;
int
m_Length
;
int
m_Width
;
};
}
// end namespace otb
#ifndef OTB_MANUAL_INSTANTIATION
#include "otbDrawLineSpatialObjectListFilter.hxx"
#endif
#endif
Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.hxx
deleted
100644 → 0
View file @
e60455a2
/*
* Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbDrawLineSpatialObjectListFilter_hxx
#define otbDrawLineSpatialObjectListFilter_hxx
#include "otbDrawLineSpatialObjectListFilter.h"
#include "itkLineIterator.h"
#include "itkDataObject.h"
#include "itkImageRegionIterator.h"
namespace
otb
{
/**
*
*/
template
<
class
TInputImage
,
class
TOutputImage
>
DrawLineSpatialObjectListFilter
<
TInputImage
,
TOutputImage
>
::
DrawLineSpatialObjectListFilter
()
{
this
->
SetNumberOfRequiredInputs
(
2
);
this
->
SetNumberOfRequiredOutputs
(
1
);
m_Value
=
static_cast
<
OutputPixelType
>
(
255.
);
}
template
<
class
TInputImage
,
class
TOutputImage
>
void
DrawLineSpatialObjectListFilter
<
TInputImage
,
TOutputImage
>
::
SetInputLineSpatialObjectList
(
const
LinesListType
*
list
)
{
this
->
ProcessObjectType
::
SetNthInput
(
1
,
const_cast
<
LinesListType
*>
(
list
));
}
template
<
class
TInputImage
,
class
TOutputImage
>
typename
DrawLineSpatialObjectListFilter
<
TInputImage
,
TOutputImage
>::
LinesListType
*
DrawLineSpatialObjectListFilter
<
TInputImage
,
TOutputImage
>
::
GetInputLineSpatialObjectList
(
void
)
{
//ROMAIN
return
static_cast
<
/*const*/
LinesListType
*>
(
this
->
ProcessObjectType
::
GetInput
(
1
));
}
template
<
class
TInputImage
,
class
TOutputImage
>
void
DrawLineSpatialObjectListFilter
<
TInputImage
,
TOutputImage
>
::
ThreadedGenerateData
(
const
OutputImageRegionType
&
outputRegionForThread
,
itk
::
ThreadIdType
itkNotUsed
(
threadId
))
{
typename
InputImageType
::
ConstPointer
input
=
this
->
GetInput
();
typename
OutputImageType
::
Pointer
output
=
this
->
GetOutput
();
typename
LinesListType
::
Pointer
list
=
const_cast
<
LinesListType
*>
(
this
->
GetInputLineSpatialObjectList
());
/** Copy the input requested region in the output requested region*/
typedef
itk
::
ImageRegionIterator
<
OutputImageType
>
OutputIteratorType
;
typedef
itk
::
ImageRegionConstIterator
<
InputImageType
>
InputIteratorType
;
OutputIteratorType
outputIt
(
output
,
outputRegionForThread
);
InputIteratorType
inputIt
(
input
,
outputRegionForThread
);
outputIt
.
GoToBegin
();
inputIt
.
GoToBegin
();
for
(
outputIt
.
GoToBegin
();
!
outputIt
.
IsAtEnd
();
++
outputIt
,
++
inputIt
)
outputIt
.
Set
(
static_cast
<
OutputPixelType
>
(
inputIt
.
Get
()));
/** Draw the lines in the output image using lineIterator*/
typedef
itk
::
LineIterator
<
OutputImageType
>
LineIteratorFilter
;
OutputIndexType
indexBeginLine
,
indexEndLine
;
LineListIterator
itList
=
list
->
begin
();
typename
InputImageType
::
SizeType
size
=
input
->
GetLargestPossibleRegion
().
GetSize
();
m_Length
=
size
[
1
];
m_Width
=
size
[
0
];
while
(
itList
!=
list
->
end
())
{
PointListType
&
pointsList
=
(
*
itList
)
->
GetPoints
();
typename
PointListType
::
const_iterator
itPoints
=
pointsList
.
begin
();
indexBeginLine
[
0
]
=
static_cast
<
OutputIndexValueType
>
((
*
itPoints
).
GetPosition
()[
0
]);
indexBeginLine
[
1
]
=
static_cast
<
OutputIndexValueType
>
((
*
itPoints
).
GetPosition
()[
1
]);
++
itPoints
;
//Get the second extremity of the segment
indexEndLine
[
0
]
=
static_cast
<
OutputIndexValueType
>
((
*
itPoints
).
GetPosition
()[
0
]);
indexEndLine
[
1
]
=
static_cast
<
OutputIndexValueType
>
((
*
itPoints
).
GetPosition
()[
1
]);
/** Crop the segment if it is outside the region in the left*/
if
(
!
(
this
->
IsColumnOutsideOfTheRegion
(
&
indexBeginLine
,
&
indexEndLine
,
&
outputRegionForThread
)
&&
this
->
IsColumnOutsideOfTheRegion
(
&
indexEndLine
,
&
indexBeginLine
,
&
outputRegionForThread
)))
{
if
(
indexEndLine
[
0
]
>=
static_cast
<
OutputIndexValueType
>
(
size
[
0
]))
this
->
CropRightSegment
(
&
indexEndLine
,
&
indexBeginLine
,
&
outputRegionForThread
);
if
(
indexBeginLine
[
0
]
>=
static_cast
<
OutputIndexValueType
>
(
size
[
0
]))
this
->
CropRightSegment
(
&
indexBeginLine
,
&
indexEndLine
,
&
outputRegionForThread
);
}
/**
* If an extremity is under the region
* Technically, the X component of the index is inside the image
*/
if
(
this
->
IsDownsideTheImage
(
&
indexBeginLine
)
&&
input
->
GetLargestPossibleRegion
().
IsInside
(
indexEndLine
))
this
->
CropSegment
(
&
indexBeginLine
,
&
indexEndLine
,
&
outputRegionForThread
);
if
(
this
->
IsDownsideTheImage
(
&
indexEndLine
)
&&
input
->
GetLargestPossibleRegion
().
IsInside
(
indexBeginLine
))
this
->
CropSegment
(
&
indexEndLine
,
&
indexBeginLine
,
&
outputRegionForThread
);
/** If the segments are not in the region (upside or downside the region)*/
if
(
!
(
this
->
IsUpsideTheRegion
(
&
indexBeginLine
,
&
outputRegionForThread
)
&&
this
->
IsUpsideTheRegion
(
&
indexEndLine
,
&
outputRegionForThread
))
&&
!
(
this
->
IsDownsideTheRegion
(
&
indexBeginLine
,
&
outputRegionForThread
)
&&
this
->
IsDownsideTheRegion
(
&
indexEndLine
,
&
outputRegionForThread
))
&&
!
(
this
->
IsColumnOutsideOfTheRegion
(
&
indexBeginLine
,
&
indexEndLine
,
&
outputRegionForThread
)
&&
this
->
IsColumnOutsideOfTheRegion
(
&
indexEndLine
,
&
indexBeginLine
,
&
outputRegionForThread
))
)
{
/** Instantiation of the line iterator with begin and ending index*/
LineIteratorFilter
itLine
(
output
,
indexBeginLine
,
indexEndLine
);
/** Iteration over the line and writing white lines */
while
(
!
itLine
.
IsAtEnd
())
{
if
(
outputRegionForThread
.
IsInside
(
itLine
.
GetIndex
()))
itLine
.
Set
(
m_Value
);
++
itLine
;
}
}
++
itList
;
}
}
/**
* Compute the intersection between the segment to draw and the region belonging to the current thread
* It is used if the segment abcisse is greater than the width of the image
*
*/