[Insight-users] Pb with itkExpandImageFilter
Cyrille Valladeau
cyrille.valladeau at c-s.fr
Wed Nov 17 03:31:27 EST 2010
Hi again,
Good new : I solved my problem !
It seems that this filter itkExpandImageFilter works well in the case
ITK_USE_CENTERED_PIXEL_COORDINATES at ON.
In the case of ITK_USE_CENTERED_PIXEL_COORDINATES = OFF as I mentionned
it in my previous mail, columns and lines of pixels at EdgePaddingValue
appears at the left of the image and at its bottom.
The correction I made is in itkImageFunction : in the SetImage method I
add a +1 in the computation of the EndContinuousIndex :
/typename InputImageType::SizeType size =
ptr->GetBufferedRegion().GetSize();
m_StartIndex = ptr->GetBufferedRegion().GetIndex();
for ( unsigned int j = 0; j < ImageDimension; j++ )
{
m_EndIndex[j] = m_StartIndex[j] + static_cast<IndexValueType>(
size[j] ) - 1;
#ifdef ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY
m_StartContinuousIndex[j] = static_cast<CoordRepType>(
m_StartIndex[j] - 0.5 );
m_EndContinuousIndex[j] = static_cast<CoordRepType>( m_EndIndex[j]
+ 0.5 );
#else
m_StartContinuousIndex[j] = static_cast<CoordRepType>(
m_StartIndex[j] );
m_EndContinuousIndex[j] = static_cast<CoordRepType>( m_EndIndex[j]
_*+ 1*_);
#endif/
Regards,
Cyrille
Cyrille Valladeau a écrit :
> Hi all,
>
> I am using the itkExpandImageFilter and I have trouble with it !
> When I use it, the right and the down border contains lines (or
> columns) at EdgePaddingValue. The length of those lines (or columns)
> depends on the ExpandFactor s...
> In attachment, the main that shows the probleme and my input image
> (only pixels at 255).
> If someone has any idea of what I am doing wrong...
>
> Thanks in advance,
> Cyrille
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
--
<www.c-s.fr> *Cyrille VALLADEAU*
Ingénieur d'études et développement - Traitement d'images
*CS Systèmes d'Information - Division Espace & Renseignement*
Département Information Géographique & Image
Parc de la Grande Plaine - 5, Rue Brindejonc des Moulinais - BP 15872
31506 Toulouse Cedex 05 - FRANCE
Tel : +33 561 17 65 72 / Fax : +33 561 34 84 15
Email : cyrille.valladeau at c-s.fr
More information about the Insight-users
mailing list