[Insight-users] itkVTKtoITKtoVTK example
Miller, James V (Research)
millerjv at crd . ge . com
Thu, 25 Jul 2002 09:04:33 -0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C233DB.D241684E
Content-Type: text/plain
I am guessing this is a problem with pixel types. vtkImageNoiseSource probably produces an image of
single
component floats. vtkJPEGReader produces an image of three component (red, green, blue) unsigned
chars.
Whe the VTK and ITK pipelines are connected together (at line 130), ITK is expecting an image of
single component
floats since this is the type of importer created. However, the vtkJPEGReader is producing an image
of 3 component
unsigned chars.
You could run the output from the vtkJPEGReader through an vtkImageLuminance to convert the RGB data
to
single component, then run that output through a vtkImageCast to convert to float pixels. Then
connect the
output of the cast to the importer.
-----Original Message-----
From: Renaud Winzenrieth [mailto:renaud.winzenrieth@utc.fr]
Sent: Thursday, July 25, 2002 5:15 AM
To: insight-users@public.kitware.com
Subject: [Insight-users] itkVTKtoITKtoVTK example
Hi ,
I can execute correctly the itkVTKtoITKtoVTK example but when I change :
vtkImageNoiseSource* source = vtkImageNoiseSource::New();
source->SetWholeExtent(0, 255, 0, 255, 0, 0);
source->SetMinimum(0);
source->SetMaximum(1);
by
vtkJPEGReader * source = vtkJPEGReader::New();
source->SetFileName("D:/renaud/These/Images/TE_00011.jpg");
(for example)
I obtain an unhandled execption (kernel32.dll) due to the RENDER function (renwin->Render()).
Anybody can help me?
Thank in advance,
renaud
------_=_NextPart_001_01C233DB.D241684E
Content-Type: text/html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META content="MSHTML 6.00.2715.400" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=694295812-25072002><FONT color=#0000ff size=2>I am guessing
this is a problem with pixel types. vtkImageNoiseSource probably produces
an image of single </FONT></SPAN></DIV>
<DIV><SPAN class=694295812-25072002><FONT color=#0000ff size=2>component
floats. vtkJPEGReader produces an image of three component (red, green,
blue) unsigned chars.</FONT></SPAN></DIV>
<DIV><SPAN class=694295812-25072002><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=694295812-25072002><FONT color=#0000ff size=2>Whe the VTK and
ITK pipelines are connected together (at line 130), ITK is expecting an image of
single component</FONT></SPAN></DIV>
<DIV><SPAN class=694295812-25072002><FONT color=#0000ff size=2>floats since this
is the type of importer created. However, the vtkJPEGReader is producing
an image of 3 component</FONT></SPAN></DIV>
<DIV><SPAN class=694295812-25072002><FONT color=#0000ff size=2>unsigned
chars.</FONT></SPAN></DIV>
<DIV><SPAN class=694295812-25072002><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=694295812-25072002><FONT color=#0000ff size=2>You could run the
output from the vtkJPEGReader through an vtkImageLuminance to convert the RGB
data to</FONT></SPAN></DIV>
<DIV><SPAN class=694295812-25072002><FONT color=#0000ff size=2>single component,
then run that output through a vtkImageCast to convert to float pixels.
Then connect the</FONT></SPAN></DIV>
<DIV><SPAN class=694295812-25072002><FONT color=#0000ff size=2>output of the
cast to the importer.</FONT></SPAN></DIV>
<DIV><SPAN class=694295812-25072002><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=694295812-25072002><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=694295812-25072002><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Renaud Winzenrieth
[mailto:renaud.winzenrieth@utc.fr]<BR><B>Sent:</B> Thursday, July 25, 2002
5:15 AM<BR><B>To:</B> insight-users@public.kitware.com<BR><B>Subject:</B>
[Insight-users] itkVTKtoITKtoVTK example<BR><BR></FONT></DIV><BR>Hi ,<BR>I can
execute correctly the itkVTKtoITKtoVTK example but when I change
:<BR><BR><FONT color=#cc66cc>vtkImageNoiseSource* source =
vtkImageNoiseSource::New();<BR> source->SetWholeExtent(0, 255, 0,
255, 0, 0);<BR> source->SetMinimum(0);<BR>
source->SetMaximum(1);</FONT><BR>by<BR><FONT color=#6633ff>
vtkJPEGReader * source = vtkJPEGReader::New();<BR>
source->SetFileName("D:/renaud/These/Images/TE_00011.jpg");</FONT><BR>(for
example)<BR>I obtain an unhandled execption (kernel32.dll) due to the RENDER
function (renwin->Render()).<BR><FONT face=Arial size=2>Anybody </FONT>can
help me?<BR><BR>Thank in advance,<BR>
renaud<BR></BLOCKQUOTE></BODY></HTML>
------_=_NextPart_001_01C233DB.D241684E--