[Insight-users] how to fill an image?

Gwenaël Guillard gwenael.guillard@enst-bretagne.fr
Thu, 05 Dec 2002 19:35:51 +0100


--------------302C3FD0528CCBADA0500235
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi Julien,

I should get new glasses! Thank you for your help.

Gwenael



Julien Jomier a écrit :

> Gwenaël,
>
> You need to define the RequestedRegion too because viewers are using
> this
> region and not the LargestPossible one.
>
> You can do:
>
> m_ZeroCrossing->SetRegions( region );
>
> wich defines the three regions at the same time.
>
> Hope this helps.
>
> Julien
>
> --
> Julien Jomier (919) 966-5857   Computer-Aided Diagnosis and Display Lab
> julien@jomier.com              Department of Radiology, CB 7515, UNC
> http://julien.jomier.com       Chapel Hill, NC 27599-7515
>
> > -----Original Message-----
> > From: insight-users-admin@public.kitware.com
> > [mailto:insight-users-admin@public.kitware.com] On Behalf Of
> > Gwenaël Guillard
> > Sent: Thursday, December 05, 2002 12:41 PM
> > To: insight-users@public.kitware.com
> > Subject: [Insight-users] how to fill an image?
> >
> >
> > Hi,
> >
> > I try to fill an image pixel by pixel using the SetPixel
> > method of image class. To initialize this image I'm trying
> > two way. The second works, but it needs to have already an
> > image. The first doesn't work. It's taken from the
> > itkExtractImageTest.cxx file. If I ask to print
> > Image->GetLargestPossibleRegion().GetSize()[1], it gives me the right
> > answer, but when I display the image: nothing except black in
> > the image viewer, with wrong size. For the second method, I
> > have the image I'm waiting for.
> >
> > Here is the code for the two methods:
> >
> > first method:
> >   int width =
> > m_Laplacian->GetOutput()->GetLargestPossibleRegion().GetSize()[0] ;
> >   int height =
> > m_Laplacian->GetOutput()->GetLargestPossibleRegion().GetSize()[1] ;
> >   ImageType::IndexType  index = {{0, 0}};
> >   ImageType::SizeType   size = {{width, height}};
> >   ImageType::RegionType region;
> >   region.SetSize( size );
> >   region.SetIndex( index );
> >   m_ZeroCrossing->SetLargestPossibleRegion( region );
> >   m_ZeroCrossing->SetBufferedRegion( region );
> >   m_ZeroCrossing->Allocate();
> >   computation with SetPixel()
> >
> > second method:
> >  m_ZeroCrossing->SetLargestPossibleRegion(
> > m_Laplacian->GetOutput()->GetLargestPossibleRegion() ) ;
> > m_ZeroCrossing->SetBufferedRegion(
> > m_Laplacian->GetOutput()->GetLargestPossibleRegion() ) ;
> > m_ZeroCrossing->SetRequestedRegion(
> > m_Laplacian->GetOutput()->GetLargestPossibleRegion() ) ;
> >  m_ZeroCrossing->Allocate() ;
> > computation with SetPixel()
> >
> >
> > Thanks,
> >
> > Gwenael
> >
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users@public.kitware.com
> > http://public.kitware.com/mailman/listinfo/ins> ight-users
> >

--
-----------------------------------------------------------
Gwenael Guillard
Doctorant
Departement Image et Traitement de l'Information (ITI)
LAboratoire  de Traitement de l'Information Medicale (LATIM) - INSERM ERM 0102
ENST Bretagne
Technopole Brest Iroise
BP 832 - 29285 Brest Cedex
Tel : 02 29 00 13 01
email : gwenael.guillard@enst-bretagne.fr, g.guillard@ieee.org



--------------302C3FD0528CCBADA0500235
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi Julien,
<p>I should get new glasses! Thank you for your help.
<p>Gwenael
<br>&nbsp;
<br>&nbsp;
<p>Julien Jomier a &eacute;crit :
<blockquote TYPE=CITE>Gwena&euml;l,
<p>You need to define the RequestedRegion too because viewers are using
<br>this
<br>region and not the LargestPossible one.
<p>You can do:
<p>m_ZeroCrossing->SetRegions( region );
<p>wich defines the three regions at the same time.
<p>Hope this helps.
<p>Julien
<p>--
<br>Julien Jomier (919) 966-5857&nbsp;&nbsp; Computer-Aided Diagnosis and
Display Lab
<br>julien@jomier.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Department of Radiology, CB 7515, UNC
<br><a href="http://julien.jomier.com">http://julien.jomier.com</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Chapel Hill, NC 27599-7515
<p>> -----Original Message-----
<br>> From: insight-users-admin@public.kitware.com
<br>> [<a href="mailto:insight-users-admin@public.kitware.com">mailto:insight-users-admin@public.kitware.com</a>]
On Behalf Of
<br>> Gwena&euml;l Guillard
<br>> Sent: Thursday, December 05, 2002 12:41 PM
<br>> To: insight-users@public.kitware.com
<br>> Subject: [Insight-users] how to fill an image?
<br>>
<br>>
<br>> Hi,
<br>>
<br>> I try to fill an image pixel by pixel using the SetPixel
<br>> method of image class. To initialize this image I'm trying
<br>> two way. The second works, but it needs to have already an
<br>> image. The first doesn't work. It's taken from the
<br>> itkExtractImageTest.cxx file. If I ask to print
<br>> Image->GetLargestPossibleRegion().GetSize()[1], it gives me the right
<br>> answer, but when I display the image: nothing except black in
<br>> the image viewer, with wrong size. For the second method, I
<br>> have the image I'm waiting for.
<br>>
<br>> Here is the code for the two methods:
<br>>
<br>> first method:
<br>>&nbsp;&nbsp; int width =
<br>> m_Laplacian->GetOutput()->GetLargestPossibleRegion().GetSize()[0]
;
<br>>&nbsp;&nbsp; int height =
<br>> m_Laplacian->GetOutput()->GetLargestPossibleRegion().GetSize()[1]
;
<br>>&nbsp;&nbsp; ImageType::IndexType&nbsp; index = {{0, 0}};
<br>>&nbsp;&nbsp; ImageType::SizeType&nbsp;&nbsp; size = {{width, height}};
<br>>&nbsp;&nbsp; ImageType::RegionType region;
<br>>&nbsp;&nbsp; region.SetSize( size );
<br>>&nbsp;&nbsp; region.SetIndex( index );
<br>>&nbsp;&nbsp; m_ZeroCrossing->SetLargestPossibleRegion( region );
<br>>&nbsp;&nbsp; m_ZeroCrossing->SetBufferedRegion( region );
<br>>&nbsp;&nbsp; m_ZeroCrossing->Allocate();
<br>>&nbsp;&nbsp; computation with SetPixel()
<br>>
<br>> second method:
<br>>&nbsp; m_ZeroCrossing->SetLargestPossibleRegion(
<br>> m_Laplacian->GetOutput()->GetLargestPossibleRegion() ) ;
<br>> m_ZeroCrossing->SetBufferedRegion(
<br>> m_Laplacian->GetOutput()->GetLargestPossibleRegion() ) ;
<br>> m_ZeroCrossing->SetRequestedRegion(
<br>> m_Laplacian->GetOutput()->GetLargestPossibleRegion() ) ;
<br>>&nbsp; m_ZeroCrossing->Allocate() ;
<br>> computation with SetPixel()
<br>>
<br>>
<br>> Thanks,
<br>>
<br>> Gwenael
<br>>
<br>> _______________________________________________
<br>> Insight-users mailing list
<br>> Insight-users@public.kitware.com
<br>> <a href="http://public.kitware.com/mailman/listinfo/ins">http://public.kitware.com/mailman/listinfo/ins</a>>
ight-users
<br>></blockquote>

<pre>--&nbsp;
-----------------------------------------------------------
Gwenael Guillard
Doctorant
Departement Image et Traitement de l'Information (ITI)
LAboratoire&nbsp; de Traitement de l'Information Medicale (LATIM) - INSERM ERM 0102
ENST Bretagne
Technopole Brest Iroise
BP 832 - 29285 Brest Cedex
Tel : 02 29 00 13 01
email : gwenael.guillard@enst-bretagne.fr, g.guillard@ieee.org</pre>
&nbsp;</html>

--------------302C3FD0528CCBADA0500235--