<div dir="ltr">I solved the proplem of memory an vtkDicomImagereader but the piple crash when placewidget call <div><br></div><div>the code is :</div><div><div> /* vtk.vtkSphereSource cone = new vtk.vtkSphereSource();</div>
<div> cone.SetRadius(1.0f);*/</div><div><br></div><div> vtk.vtkDICOMImageReader VDR = new vtk.vtkDICOMImageReader();</div><div> VDR.SetDirectoryName(@"G:\Master Degree\test DataSet\My Disc\07291640");</div>
<div> VDR.SetDataOrigin(0, 0, 0);</div><div> VDR.Modified();</div><div><br></div><div> // decrease the dataset data for large data preprocessing </div><div><br></div><div> vtkImageShrink3D VIS = new vtkImageShrink3D();</div>
<div> VIS.SetShrinkFactors(2, 2, 2);</div><div> VIS.SetInputConnection(VDR.GetOutputPort());</div><div> VIS.Modified();</div><div><br></div><div> vtkImageThreshold VIT = new vtkImageThreshold();</div>
<div> VIT.ThresholdBetween(200, 2000);</div><div> VIT.SetInputConnection(VIS.GetOutputPort());</div><div> VIT.Modified(); </div><div><br></div><div> ///// Start the creation of volume rendering </div>
<div><br></div><div> //1. Gget the range of data </div><div> vtk.vtkImageChangeInformation VIC = new vtk.vtkImageChangeInformation();</div><div> VIC.SetInput(VIT.GetOutput());</div>
<div> VIC.CenterImageOn();</div><div> VIC.Modified();</div><div><br></div><div> vtk.vtkImageData VoxelData = new vtk.vtkImageData();</div><div> VoxelData = VIC.GetOutput();</div>
<div><br></div><div> double[] metaScalarRange = VoxelData.GetScalarRange();</div><div><br></div><div><br></div><div> // Render the skin - Soft tissue </div><div> double isovalue = 0.8 * (metaScalarRange[1] + metaScalarRange[0]);</div>
<div><br></div><div><br></div><div> vtkContourFilter skinExtractor = new vtkContourFilter();</div><div> skinExtractor.SetInputConnection(VIT.GetOutputPort());</div><div> skinExtractor.SetValue(0, isovalue);</div>
<div> skinExtractor.ComputeGradientsOn();</div><div> skinExtractor.Modified();</div><div><br></div><div><br></div><div> gpd = skinExtractor.GetOutput();</div><div><br></div><div>
vtk.vtkPolyDataMapper coneMapper = new vtk.vtkPolyDataMapper();</div><div> coneMapper.SetInput(gpd);</div><div> coneMapper.ScalarVisibilityOff();</div><div><br></div><div> maceActor = new vtkLODActor();</div>
<div> maceActor.SetMapper(coneMapper);</div><div> maceActor.GetProperty().SetColor(1, 0, 0);</div><div> //////////////////////// Selection Part /////////////////////////</div><div>
planes = new vtkPlanes();</div><div><br></div><div> clipper = new vtkClipPolyData();</div><div> clipper.SetInput(gpd);</div><div> clipper.SetClipFunction(planes);</div>
<div> clipper.InsideOutOn();</div><div> clipper.Modified();</div><div> vtkPolyDataMapper selectMapper = new vtkPolyDataMapper();</div><div> selectMapper.SetInput(clipper.GetOutput());</div>
<div> selectMapper.ScalarVisibilityOff();</div><div> selectMapper.Modified();</div><div> selectActor = new vtkLODActor();</div><div> selectActor.SetMapper(selectMapper);</div>
<div> selectActor.GetProperty().SetColor(0, 1, 0);</div><div> selectActor.VisibilityOff();</div><div> selectActor.SetScale(1.01, 1.01, 1.01);</div><div> selectActor.Modified();</div>
<div> /////////////////////// End of selection part////////////////////</div><div><br></div><div> //////////////////////////// Cutting part /////////////////////////////////</div><div><br></div>
<div><br></div><div> clipper_cutting = new vtkClipPolyData();</div><div> clipper_cutting.SetInput(gpd);</div><div> clipper_cutting.SetClipFunction(planes);</div><div> clipper_cutting.InsideOutOff();</div>
<div> clipper_cutting.GenerateClippedOutputOff();</div><div> clipper_cutting.Modified();</div><div> vtkPolyDataMapper selectMapper_cutting = new vtkPolyDataMapper();</div><div>
selectMapper_cutting.SetInput(clipper_cutting.GetOutput());</div><div> selectMapper_cutting.ScalarVisibilityOff();</div><div> selectMapper_cutting.Modified();</div><div> selectActor_cutting = new vtkLODActor();</div>
<div> selectActor_cutting.SetMapper(selectMapper_cutting);</div><div> selectActor_cutting.GetProperty().SetColor(1, 0, 0);</div><div> selectActor_cutting.VisibilityOff();</div>
<div> selectActor_cutting.SetScale(1.01, 1.01, 1.01); </div><div> selectActor_cutting.Modified();</div><div><br></div><div> //////////////////////////// End Cutting part //////////////////////////////////////</div>
<div> vtk.vtkRenderer ren1 = new vtk.vtkRenderer();</div><div> ren1.Modified();</div><div> renWin.AddRenderer(ren1);</div><div> //ren1.SetBackground(0.0f, 0.0f, 0.0f);</div>
<div><br></div><div> vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor();</div><div> iren.SetRenderWindow(renWin);</div><div><br></div><div><br></div><div><br></div><div> //The SetInteractor method is how 3D widgets are associated with the</div>
<div> //render window interactor. Internally, SetInteractor sets up a bunch</div><div> //of callbacks using the Command/Observer mechanism (AddObserver()).</div><div> vtkBoxWidget boxWidget = new vtkBoxWidget();</div>
<div> boxWidget.SetInteractor(iren);</div><div> boxWidget.SetPlaceFactor(1.25);</div><div> boxWidget.TranslationEnabledOn();</div><div><br></div><div><br></div><div><br></div><div>
ren1.AddActor(maceActor);</div><div> ren1.AddActor(selectActor);</div><div> ren1.AddActor(selectActor_cutting);</div><div><br></div><div> boxWidget.SetInput(gpd); </div>
<div> <span class="Apple-style-span" style="background-color: rgb(255, 255, 0);"> boxWidget.Modified(); // crash here</span></div><div> boxWidget.PlaceWidget();</div><div><br></div><div> boxWidget.AddObserver((uint)vtk.EventIds.StartInteractionEvent, new vtk.vtkDotNetCallback(StartInteractionEvent));</div>
<div> boxWidget.AddObserver((uint)vtk.EventIds.InteractionEvent, new vtk.vtkDotNetCallback(InteractionEvent));</div><div> boxWidget.AddObserver((uint)vtk.EventIds.EndInteractionEvent, new vtk.vtkDotNetCallback(EndInteractionEvent));</div>
<div><br></div><div><br></div><div> boxWidget.On();</div><div><br></div><div> renWin.AddRenderer(ren1); renWin.Modified();</div><div><br></div><div>any suggestion please </div><br><div class="gmail_quote">
On Sun, Sep 5, 2010 at 12:01 AM, Darshan Pai <span dir="ltr"><<a href="mailto:darshanpai@gmail.com">darshanpai@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I have been using DICOMReader in 64 bit OS and it has not crashed on me before . Probably its a memory error . I usually convert it into Analyze format and reduce the dimensions or the data type so that it can be loaded . Maybe you can try that .<br>
<br>Regards<br>Darshan<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Fri, Sep 3, 2010 at 5:44 PM, Ali Habib <span dir="ltr"><<a href="mailto:ali.mahmoud.habib@gmail.com" target="_blank">ali.mahmoud.habib@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><div><div></div><div class="h5">
<div dir="ltr">it's 245 MB data , I will search for that I use c# and vista as operating system<div><br><br><div class="gmail_quote">On Sat, Sep 4, 2010 at 12:32 AM, John Drescher <span dir="ltr"><<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><div><div></div><div>On Fri, Sep 3, 2010 at 5:28 PM, John Drescher <<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a>> wrote:<br>
>> I successfully read DICOM data using vtkDICOMImageReader for directory<br>
>> contains 78 files<br>
>> But when tried to load from directory contains 418 files , my application<br>
>> crashed<br>
>> vtk.vtkDICOMImageReader VDR = new vtk.vtkDICOMImageReader();<br>
>> VDR.SetDirectoryName(@"G:\Master Degree\test DataSet\My<br>
>> Disc\07291640");<br>
>> VDR.SetDataOrigin(0, 0, 0);<br>
>> VDR.Modified();<br>
>> any suggestion please , or is there any limits regarding vtkDICOMImageReader<br>
><br>
> I believe it is limited to around 4GB dicom files since the reader<br>
> uses 32 bit index pointers.<br>
><br>
<br>
</div></div>In 32bit windows however you will be limited by the largest<br>
allocatable memory block which should be around 1.2GB ( even if your<br>
PC has 4 GB of ram) unless you have your program compiled with the<br>
LARGEADDRESSAWARE linker flag and you have your OS set to allow 3GB<br>
applications.<br>
<font color="#888888"><br>
John<br>
</font></blockquote></div><br></div></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>
</blockquote></div><br></div></div>