<span class="ik"></span><h3 class="gD" style="color: rgb(121, 6, 25);"><font size="2"><span style="color: rgb(0, 0, 0); font-weight: normal;">Karthik Krishnan, thanks for your great help!<br></span></font></h3><h3 class="gD" style="color: rgb(121, 6, 25);">
<font size="2"><span style="color: rgb(0, 0, 0); font-weight: normal;">However, firstly, i still can not understand the mean of the parameter-value in the member function-SetValue(int i, double value</span><span style="color: rgb(0, 0, 0);"><span style="font-weight: normal;">) of vtkMarchingCubes. For example, if the value is set to 110 (The type of dataset is bmp ),</span> <span style="font-weight: normal;">which isosurfaces should be extracted? The structure whose gray value is 110 or all structures whose gray value is below 110 ? Could you tell me?! <br>
</span></span></font></h3>Secondly, could you provide some examples for the vtkDiscreteMarchingCubes , though i read the help in the "vtk documentation", there is no detailed example illustrating it. I also do not know how to color the result ! From my perspective, we can control the color through vtkActor, there are other methods to control the properties of parts of the actor?<br>
<br>Thanks.<br><br>Wenwu<br><br><br><br><div class="gmail_quote">On Wed, Apr 14, 2010 at 5:17 PM, Karthik Krishnan <span dir="ltr"><<a href="mailto:karthik.krishnan@kitware.com">karthik.krishnan@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">You could use vtkDiscreteMarchingCubes and color the result by cell data<br><br>or<br><br>pre-process your data to set all the non-foreground voxels to background, (so as to make it bilelvel) and then run marching cubes to extract each label.<br>
<br><div class="gmail_quote"><div><div></div><div class="h5">On Wed, Apr 14, 2010 at 4:44 AM, 朱文武 <span dir="ltr"><<a href="mailto:cool.wenwu@gmail.com" target="_blank">cool.wenwu@gmail.com</a>></span> wrote:<br></div>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
hi all,<br> <br> A problem confused me. I need your help. The
class vtkMarchingCubes has been adapted to construct a specified
structure ( extract specified isosurface), the member function—
vtkMarchingCubes::setvalue(int i, double value) is used to specify a
particular contour value. The type of dataset i used was gray bmp
image. Suppose the dataset contains gray value: 91, 111, 121, 137.<br>
Now the problem is that if i want to construct the anatomy structure whose gray value is 111, so the code i write is that<br>SetValue(0,
111). However, the result of construction is that almost all anatomy
structures whose gray value is 91, 121, 137 have been constructed too.
Why is it happens? what's the difference between the gray value in the
bmp image and the contour value in this function? And how to construct
a specified structure? <br>
<br>If we set the parameter -value to 111, according to the MC
algorithm, the specified isosurface should be extracted. Do i
understand wrong !?<br>On the other hand, if i want to extract multiple
isosurface and control property of each isosurface such as colors, how
to do it? The function SetValue(int i, double value) can not accomplish
the task. Though we can add contour value by increasing the index-i,
the output of the vtkMarchingCubes is combined to the subsequent
filter. Can anyone provide help? Thanks very much !<br>
<br>The relevant code and original image and result of the construction is attached:<br><br>Code:<br> vtkBMPReader *Image= vtkBMPReader::New();<br> // read the dataset <br> Image->Update();<br><br> vtkMarchingCubes *skinExtractor=
vtkMarchingCubes::New();//<div>skinGray=220,tendon=10,radius=20,ulna=40,<br>
skinExtractor->SetInputConnection(Image->GetOutputPort());<br> <span style="background-color: rgb(255, 0, 0);"> skinExtractor->SetValue(0,111);// input the gray value </span><span style="background-color: rgb(255, 255, 255);"></span><br>
skinExtractor->ComputeGradientsOn();<br> skinExtractor->ComputeScalarsOff();<br> <br> vtkDecimatePro *vdeci;<br> vdeci->SetInputConnection(skinExtractor->GetOutputPort());//<br> vdeci->SetTargetReduction(0.6);//<br>
vdeci->PreserveTopologyOn();//<br><br> vtkSmoothPolyDataFilter *vsmoother;<br> vsmoother->SetInputConnection(vdeci->GetOutputPort());//<br> vsmoother->SetNumberOfIterations(800);//<br> <br> vtkPolyDataNormals *vskinNormal;<br>
vskinNormal->SetInputConnection(vsmoother->GetOutputPort());//<br> vskinNormal->SetFeatureAngle(60.0);//<br><br> vtkPolyDataMapper *vskinMapper;<br> vskinMapper->SetInputConnection(vskinNormal->GetOutputPort());<br>
vskinMapper->ScalarVisibilityOff();//<br> <br> vtkActor *vskin;<br> vskin->SetMapper(vskinMapper);//<br> vskin->GetProperty()->SetColor(1,0,0);<br><br>The original image :<br><img title="TCVH_1300副本.bmp" alt="TCVH_1300副本.bmp" src="cid:ii_127fb7d0142c1f89" width="149" height="174"><br>
</div>
<br></div></div>_______________________________________________<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>
<br></blockquote></div><br><br clear="all"><br><br>
</blockquote></div><br><br clear="all"><br>-- <br>祝<br>工作愉快,身体健康!<br>