<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> </div>
<div>First of all thanks a lot for your reply. If I improve the RAM and the Graphic card Memory... Do you think my problem 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> </div>
<div class="EC_gmail_quote">On Mon, Apr 28, 2008 at 12:57 PM, Cameron Burnett <<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>> 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> try<br> {<br> filter->Update();<br> }<br> catch( itk::ExceptionObject & excep )<br> {<br> CString msg;<br> msg.Format("Error: %s", excep.GetDescription());<br> AfxMessageBox(msg, MB_ICONERROR);<br>
}<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> typedef itk::StreamingImageFilter< OutputImageType,OutputImageType > StreamingFilterType;<br> StreamingFilterType::Pointer streamer = StreamingFilterType::New();<br> streamer->SetReleaseDataFlag(true);<br>
<br> streamer->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->SetFileNames(files);<br>
pitkDICOMReader->SetImageIO( itk::GDCMImageIO::New() );<br>pitkDICOMReader->Update();<br>filter = ThresholdType::New();<br>filter->SetInput( this->pitkDICOMReader);<br>filter->ThresholdOutside(minT, maxT);<br>
filter->Update();<br>...<br>( typedef itk::ImageToVTKImageFilter<ImageType> ConnectorType; )<br>connector->SetInput( filter->GetOutput() );<br>connector->Update();<br><br>/*now I create a 3D polydata*/<br>
contourFilter->SetInput(connector->GetOutput());<br>contourFilter->Update();<br>smoothFilter->SetInputConnection(contourFilter->GetOutputPort());<br>smoothFilter->SetNumberOfIterations(30);<br>smoothFilter->SetRelaxationFactor(1.0);<br>
smoothFilter->Update();<br>polyDataNormals->SetInputConnection(smoothFilter->GetOutputPort());<br>polyDataNormals->Update();<br>this->BoneMapper->SetInput(polyDataNormals->GetOutput());<br>this->BoneMapper->Update();<br>
this->BoneActor->SetMapper(this->BoneMapper);<br>this->BoneActor->GetProperty()->SetColor(1.0, 1.0, 0.0);<br>this->BoneActor->GetProperty()->SetDiffuse(0.0);<br>this->BoneActor->GetProperty()->SetSpecular(1.0);<br>
this->BoneActor->GetProperty()->SetSpecularPower(5);<br>this->pvtkRenderer3D->AddActor(this->BoneActor);<br>this->pvtkRenderer3D->ResetCamera();<br>if (this->pvtkMFCWindow3D) this->pvtkMFCWindow3D->RedrawWindow(); //"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>