[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtkusers
Subject:    [vtkusers] How to change Input data with vtkImageStencil
From:       "Michael Knopke" <Michael.Knopke () gmx ! de>
Date:       2007-03-30 12:35:13
Message-ID: 000001c772c7$de8f9a80$4378a8c0 () imagesystems ! local
[Download RAW message or body]

Hello,

 

I know that this is a big NoNo for any filter in VTK but still, this is  a
necessary procedure.
What I want to do is use the class vtkImageStencil to permanently setting
selected pixels blank (=0).
I already have a working pipeline that does this on the output which is ok,
but I need it to simultaneously do this with the corresponding input data,
so that I can redo the filtering without loosing  the results from the step
before.

I think I located the piece of code that does sets the pixel in the output:

 

In vtkImageStencil.cxx

 

Row 277:

 

for (idX = cr1; idX <= cr2; idX++)

          {

          vtkCopyPixel(outPtr, tempPtr, numscalars);

          

                          tempPtr += inIncX;

          }

 

Where tempPtr is set to the desired background value (e.g. 0)
Using the same thing with inPtr will not work, since it would increment the
pointer and later getting out of range.
Can anybody help with this please?



Regards



Michaeö


[Attachment #3 (text/html)]

<html xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.E-MailFormatvorlage17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span lang=DE style='font-size:10.0pt;
font-family:Arial'>Hello,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=DE style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I know that this is a big NoNo for any filter in VTK but
still, this is  a necessary procedure.<br>
What I want to do is use the class vtkImageStencil to permanently setting
selected pixels blank (=0).<br>
I already have a working pipeline that does this on the output which is ok, but
I need it to simultaneously do this with the corresponding input data, so that
I can redo the filtering without loosing  the results from the step \
before.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I think I located the piece of code that does sets the pixel
in the output:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>In vtkImageStencil.cxx<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Row 277:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>for (idX = cr1; idX &lt;= cr2; idX++)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>          {<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>          vtkCopyPixel(outPtr, tempPtr, \
numscalars);<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>          <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>                          tempPtr += \
inIncX;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>          }<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Where tempPtr is set to the desired background value (e.g. 0)<br>
Using the same thing with inPtr will not work, since it would increment the
pointer and later getting out of range.<br>
Can anybody help with this please?<br>
<br>
<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Regards<br>
<br>
<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Michaeö<o:p></o:p></span></font></p>

</div>

</body>

</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic