[Insight-developers] Re: backward imcompatible changes in gaussian
spatial object ?
Gaetan Lehmann
gaetan.lehmann at jouy.inra.fr
Mon Jan 15 08:52:41 EST 2007
It works,
Thanks !
Gaetan
On Mon, 15 Jan 2007 14:24:51 +0100, Julien Jomier
<julien.jomier at kitware.com> wrote:
> Gaetan,
>
> There was a bug in the itkGaussianSpatialObject. Basically it was not
> using the radius information and therefore was taking a very long time
> to be rasterized. If you want your test to pass with the current
> baseline image, you can increase the radius of the Gaussian and that
> should work, otherwise let me know.
>
> Julien
>
> Gaëtan Lehmann wrote:
>> Julien,
>> I seem that the changes you have done in the gaussian spatial objet
>> recently are changing the result produced by one the WrapITK tests:
>>
>> http://www.itk.org/Testing/Sites/marvin.jouy.inra.fr/Linux-gcc-Debug/20070113-0100-Nightly/Results/__Wrapping_WrapITK_Python_Tests_PythonSpatialObject.html
>> Are those changes backward incompatibles, or is it a problem in the
>> way I have used that gaussian spatial object ?
>> Thanks,
>> Gaetan
>> import itk
>> from sys import argv, stderr, exit
>> itk.auto_progress(2)
>> dim = 2
>> SOType = itk.SpatialObject[dim]
>> InternalImageType = itk.Image[itk.F, dim]
>> OutputPixelType = itk.UC
>> OutputImageType = itk.Image[OutputPixelType, dim]
>> ellipse = itk.EllipseSpatialObject[dim].New( Radius=[10,5] )
>> ellipse.GetObjectToParentTransform().SetOffset( [20,20] )
>> ellipse.ComputeObjectToWorldTransform()
>> box = itk.BoxSpatialObject[dim].New( Size=20 )
>> box.GetObjectToParentTransform().SetOffset( [20,40] )
>> box.ComputeObjectToWorldTransform()
>> gaussian = itk.GaussianSpatialObject[dim].New()
>> gaussian.GetObjectToParentTransform().SetOffset( [60,60] )
>> gaussian.GetObjectToParentTransform().SetScale( 10 )
>> gaussian.ComputeObjectToWorldTransform()
>> group = itk.GroupSpatialObject[dim].New()
>> group.AddSpatialObject( ellipse.GetPointer() )
>> group.AddSpatialObject( box.GetPointer() )
>> group.AddSpatialObject( gaussian.GetPointer() )
>> filter = itk.SpatialObjectToImageFilter[SOType,
>> InternalImageType].New( group, Size=[100,100], UseObjectValue=True )
>> filter.Update() # required ?!
>> rescale = itk.RescaleIntensityImageFilter[InternalImageType,
>> OutputImageType].New( filter,
>> OutputMinimum=itk.NumericTraits[OutputPixelType].NonpositiveMin(),
>> OutputMaximum=itk.NumericTraits[OutputPixelType].max() )
>> itk.write(rescale, argv[1])
>> --Gaëtan Lehmann
>> Biologie du Développement et de la Reproduction
>> INRA de Jouy-en-Josas (France)
>> tel: +33 1 34 65 29 66 fax: 01 34 65 29 09
>> http://voxel.jouy.inra.fr
>>
--
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66 fax: 01 34 65 29 09
http://voxel.jouy.inra.fr
More information about the Insight-developers
mailing list