<br><br><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">An update of the previous code, seems that setDimensions is going to be deprecate at some point and is just for backwards compatibility so this is how it's looks now using setExtent instead:<div>
<br></div><div><div> //image_data.SetDimensions(width, height, 1);</div>
<div>image_data.SetExtent(0, width - 1 ,0, height - 1, 0, 0);</div><div>image_data.SetScalarTypeToDouble();</div><div>image_data.SetNumberOfScalarComponents(1);</div><div>image_data.SetSpacing(1.0, 1.0, 1.0);</div><div>
image_data.SetOrigin(0.0, 0.0, 0.0);</div>
<div>image_data.SetScalarComponentFromDouble(0, 0, 0, 0, 200.0);</div><div>image_data.AllocateScalars();</div><div><br></div><div>Now I'm trying to figure out how to get the scalars from the probed surface</div><div>
<br></div><div>sampleVolume.GetOutput().GetPointData().GetScalars() it's returning me a null pointer...</div><div>any suggestion?</div><div><div class="h5"><br><div class="gmail_quote">2012/5/30 Jonathan Ruiz Peinado <span dir="ltr"><<a href="mailto:jonathan.ruiz3@gmail.com" target="_blank">jonathan.ruiz3@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ok, so I misunderstand some basics of VTK.<div>I'm not sure about the meaning of cell or point, thanks it shows me something more about it.</div>
<div>Is there some URL where I can go to get the basic theory about it ?</div>
<div><br></div><div>This is how the code looks now, fisrt I'm going to show you how I'm Building the surface:</div><div><div><br></div><div>rows = spline.GetOutput().GetNumberOfPoints();</div><div>col =dicomImage.getNormalized().GetOutput().GetDimensions()[2];</div>
<div>for (int row = 0; row < rows; row++)</div><div> {</div><div> for (int col = 0; col < cols; col++)</div><div> {</div><div> double [] p = new double [3];</div><div> line.GetPoint(row, p);</div>
<div> x[0] = p[0] + direction[0] * col * spacing;</div><div> x[1] = p[1] + direction[1] * col * spacing;</div><div> x[2] = p[2] + direction[2] * col * spacing;</div><div> points.InsertPoint(cnt++, x);</div>
<div> }</div><div> }</div></div><div><br></div><div>An now how I've fixed the code that was wrong in my previous message:</div><div><div>vtkImageData image_data= new vtkImageData();</div><div> </div>
<div>int width = spline.GetOutput().GetNumberOfPoints(); </div><div>int height = dicomImage.getNormalized().GetOutput().GetDimensions()[2]; </div><div> </div><div>image_data.SetDimensions(width, height, 1); // 1 because I just want an slice by now</div>
</div><div>//image_data.SetSpacing(); </div><div><br></div><div><br></div><div>Do I need to set the Spacing of the image_data or it has a valid default value?</div><div><div><div><br></div><div>
<br></div><div> </div><div><br><div class="gmail_quote">
2012/5/29 Sebastien Jourdain <span dir="ltr"><<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The dimension is related to the number of points....<br>
<br>
Meaning one dimension will be the number of points that compose your<br>
spline and the other will be the number of iteration the swipe is<br>
doing.<br>
<br>
Seb<br>
<div><div><br>
On Tue, May 29, 2012 at 12:46 PM, jruiz <<a href="mailto:jonathan.ruiz3@gmail.com" target="_blank">jonathan.ruiz3@gmail.com</a>> wrote:<br>
> Thanks, I'm going to follow your instructions step by step, first I'm trying<br>
> to get de surface area to set the dimension of the image data.<br>
><br>
> Is it even close ? I'm getting the length for the extruded spline as "width"<br>
> and "height" is the length of the extrusion. I guess this values need to be<br>
> multiply by the spacing what I get from the source image.<br>
><br>
> vtkImageData image_data= new vtkImageData();<br>
><br>
> double[] spacing = dicomImage.getNormalized().GetOutput().GetSpacing();<br>
><br>
> double width = spline.GetLength() * spacing[0];<br>
> double height = surfaceHeight * spacing[2];<br>
><br>
> image_data.SetDimensions(width, height, 1);<br>
><br>
> --<br>
> View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Flattening-a-probed-surface-tp5713443p5713466.html" target="_blank">http://vtk.1045678.n5.nabble.com/Flattening-a-probed-surface-tp5713443p5713466.html</a><br>
> Sent from the VTK - Users mailing list archive at Nabble.com.<br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br>