<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><div style="text-align: left;">I'm working with 2GB at the moment. If I call SetReleaseDataFlag(true) on every filter in my pipeline, then I can work with DICOM datasets up to about 400MB. More RAM would surely help (provided that you're not using a single core processor), but there are ways around it like the ones I told you about in the email. And there are certain benefits/drawbacks for either approach..... like if you don't release your data it will chew up your memory but will be quite fast.... and if you do release then it will use less memory but will be slower (from my experience it has been slower).<br><br>As for the try/catch thing.... did you try putting that around every update function?? If you go through and do each one separately then you should eventually find the one that is the problem.<br></div><br><div></div><br><br><blockquote><hr id="EC_stopSpelling">Date: Mon, 5 May 2008 10:57:59 +0200<br>From: ivan.gm.itk@gmail.com<br>To: vtkusers@vtk.org<br>Subject: [vtkusers] Exception problems<br><br><div class="EC_gmail_quote"><br><div>Hello Cameron:</div>
<div>&nbsp;</div>
<div>First of all thanks a lot for your reply. If I improve the RAM and the Graphic card Memory... Do you think&nbsp;my problem&nbsp;could be solved? I'm using 2 GB of RAM and 256 MB of Graphics Memory now.</div>
<div>NOTE: The try catch didn't catch the last message exception mentioned.</div><div><div></div><div class="EC_Wj3C7c">
<div><br><br>&nbsp;</div>
<div class="EC_gmail_quote">On Mon, Apr 28, 2008 at 12:57 PM, Cameron Burnett &lt;<a href="mailto:w_e_b_m_a_s_t_e_r_6_9@hotmail.com">w_e_b_m_a_s_t_e_r_6_9@hotmail.com</a>&gt; wrote:<br>
<blockquote class="EC_gmail_quote" style="padding-left: 1ex;">
<div>
<div style="text-align: left;">The problem is probably due to a lack of memory. You can catch these problems by putting a try/catch around your Update() functions, and you should get an error message. This is the code you can use for MFC.<br>

<br>&nbsp; try<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; filter-&gt;Update();<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp; catch( itk::ExceptionObject &amp; excep )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CString msg;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; msg.Format("Error: %s", excep.GetDescription());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; AfxMessageBox(msg, MB_ICONERROR);<br>

&nbsp;&nbsp;&nbsp; }<br><br><br>If you want to fix this you can do a few things. One thing you can do is call the SetReleaseDataFlag(true) function on everything in your pipeline. This will release memory once it's no longer in use, however it will slow down your program considerably.<br>

<br>Some filters also support streaming. This breaks a task down into smaller pieces and you end up not needing to allocate a lot of memory all at once. You can set it up like this, and you just simply connect it to your pipeline and call Update() on it in order to stream through the pipeline.<br>

<br>&nbsp; typedef itk::StreamingImageFilter&lt; OutputImageType,OutputImageType &gt; StreamingFilterType;<br>&nbsp; StreamingFilterType::Pointer streamer = StreamingFilterType::New();<br>&nbsp; streamer-&gt;SetReleaseDataFlag(true);<br>

<br>&nbsp; streamer-&gt;SetNumberOfStreamDivisions(4);<br><br><br>Have a look at your operating system's memory usage while you run the program. And if you include the try/catch thing you should be able to figure out where your program gets up to before it runs out of memory. Note that the program will continue to run after that point, and that is why it seems like it works until the end.<br>

<br><br>Hope this helps,<br><br>Cameron.<br><br></div><br>
<div></div><br><br>
<blockquote>
<hr>
Date: Mon, 28 Apr 2008 11:08:41 +0200<br>From: <a href="mailto:ivan.gm.itk@gmail.com">ivan.gm.itk@gmail.com</a><br>To: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>Subject: [vtkusers] Exception problems 
<div>
<div></div>
<div><br><br>Hello:<br><br>I have a problem with a not controled exception in runtime. I'm using windows, MFC, VTK, ITK in Visual Studio 2005. My code looks like this:<br><br>....<br>pitkDICOMReader-&gt;SetFileNames(files);<br>

pitkDICOMReader-&gt;SetImageIO( itk::GDCMImageIO::New() );<br>pitkDICOMReader-&gt;Update();<br>filter = ThresholdType::New();<br>filter-&gt;SetInput( this-&gt;pitkDICOMReader);<br>filter-&gt;ThresholdOutside(minT, maxT);<br>

filter-&gt;Update();<br>...<br>( typedef itk::ImageToVTKImageFilter&lt;ImageType&gt; ConnectorType; )<br>connector-&gt;SetInput( filter-&gt;GetOutput() );<br>connector-&gt;Update();<br><br>/*now I create a 3D polydata*/<br>

contourFilter-&gt;SetInput(connector-&gt;GetOutput());<br>contourFilter-&gt;Update();<br>smoothFilter-&gt;SetInputConnection(contourFilter-&gt;GetOutputPort());<br>smoothFilter-&gt;SetNumberOfIterations(30);<br>smoothFilter-&gt;SetRelaxationFactor(1.0);<br>

smoothFilter-&gt;Update();<br>polyDataNormals-&gt;SetInputConnection(smoothFilter-&gt;GetOutputPort());<br>polyDataNormals-&gt;Update();<br>this-&gt;BoneMapper-&gt;SetInput(polyDataNormals-&gt;GetOutput());<br>this-&gt;BoneMapper-&gt;Update();<br>

this-&gt;BoneActor-&gt;SetMapper(this-&gt;BoneMapper);<br>this-&gt;BoneActor-&gt;GetProperty()-&gt;SetColor(1.0, 1.0, 0.0);<br>this-&gt;BoneActor-&gt;GetProperty()-&gt;SetDiffuse(0.0);<br>this-&gt;BoneActor-&gt;GetProperty()-&gt;SetSpecular(1.0);<br>

this-&gt;BoneActor-&gt;GetProperty()-&gt;SetSpecularPower(5);<br>this-&gt;pvtkRenderer3D-&gt;AddActor(this-&gt;BoneActor);<br>this-&gt;pvtkRenderer3D-&gt;ResetCamera();<br>if (this-&gt;pvtkMFCWindow3D)&nbsp;&nbsp;&nbsp; this-&gt;pvtkMFCWindow3D-&gt;RedrawWindow();&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; //"the program crash here"<br>

<br>When I open 3D images with 100 slices it runs perfect but with one of the images (with 350 slices) the program crash in runtime and Visual Studio shows the following error message:<br><br>Excepción no controlada en 0x0d9e5c01 en myaplication.exe: 0xC0000005: Infracción de acceso al escribir en la ubicación 0x00000000.<br>

<br>After that the file ftime64.c apairs in Visual Studio at line 130 where it calls to _ftime64_s(tp);<br><br>In addition, when I comment the smoothfilter and other previous filters it works good.<br><br>What could the problem be? Do you know how I can solve it?<br>

<br><br>Thanks a lot.<br><br>Iván García Martínez.<br></div></div></blockquote><br>
<hr>
before someone else does <a href="http://mycareer.com.au/?s_cid=596064" target="_blank">Find the job of your dreams</a></div></blockquote></div><br>
</div></div></div><br>
</blockquote><br /><hr />Hotmail on your mobile. <a href='http://www.livelife.ninemsn.com.au/article.aspx?id=343869' target='_new'>Never miss another e-mail with </a></body>
</html>