<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
(1) Try <span class="Apple-style-span" style="font-family: 'courier new', monospace; color: rgb(42, 42, 42); ">HessianPixelType</span> of type <font class="Apple-style-span" face="'Courier New'">double</font>.<div>(2) Instead of <span class="Apple-style-span" style="font-family: 'courier new', monospace; ">HessianToObjectnessMeasureImageFilter</span> use <font class="Apple-style-span" face="'Courier New'">Hessian3DToVesselnessMeasureImageFilter</font>.</div><div><div><br></div><div>RS.<br><br><hr id="stopSpelling">Date: Mon, 11 Oct 2010 12:22:02 +0200<br>From: sergio.vera@alma3d.com<br>To: insight-users@itk.org<br>Subject: [Insight-users] MultiScaleHessianBasedMeasureImageFilter + HessianToObjectnessMeasureImageFilter, empty image<br><br>Hello all<div><br></div><div>Currently I use HessianRecursiveGaussianImageFilter Hessian3DToVesselness to enhance coronary arteries in CTA images. I would like to test the multiscale hessian enhancement using MultiScaleHessianBasedMeasureImageFilter and HessianToObjectnessMeasureImageFilter, however, I'm only obtainig empty (black) images as a result of the enhancement and the scales.</div>
<div><br></div><div>Here is a snippet of the code:</div><div><div> </div><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">typedef itk::ThresholdImageFilter<ITKImgInType> ThrFilter;</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">ThrFilter::Pointer thr = ThrFilter::New();</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">thr->SetInput(&a_imgIn);</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">thr->SetLower(80); </font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">thr->SetUpper(10000); // remove other parts of the image with low values</font> </blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace"><br></font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">typedef itk::CastImageFilter<ITKImgInType, F1d3ITKImgType> CastFilter;</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">CastFilter::Pointer cast2float = CastFilter::New();</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">cast2float->SetInput(thr->GetOutput());</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace"><br></font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">typedef itk::SymmetricSecondRankTensor<float, 3> HessianPixelType;</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">typedef itk::Image<HessianPixelType, 3> HessianImage;</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace"><br></font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">typedef itk::MultiScaleHessianBasedMeasureImageFilter </font><span class="ecxApple-style-span" style="font-family:'courier new', monospace"><F1d3ITKImgType, HessianImage, F1d3ITKImgType> HessianFilter;</span></blockquote>
<blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">HessianFilter::Pointer hessian = HessianFilter::New();</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">hessian->SetInput(cast2float->GetOutput());</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">hessian->SetNumberOfSigmaSteps(6);</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">hessian->SetSigmaStepMethodToEquispaced();</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">hessian->SetSigmaMinimum(1.1);</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">hessian->SetSigmaMinimum(2.4); // This sizes in mm?</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">hessian->SetGenerateHessianOutput(true);</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">hessian->SetGenerateScalesOutput(true);</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace"><br></font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<span class="ecxApple-tab-span" style="white-space:pre"><font class="ecxApple-style-span" face="'courier new', monospace">ty</font></span><font class="ecxApple-style-span" face="'courier new', monospace">pedef itk::HessianToObjectnessMeasureImageFilter </font><span class="ecxApple-style-span" style="font-family:'courier new', monospace"><HessianImage, F1d3ITKImgType> ObjectnessFilter;</span></blockquote>
<blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">ObjectnessFilter::Pointer vesselFilter = ObjectnessFilter::New();</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">vesselFilter->SetScaleObjectnessMeasure(false);</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">vesselFilter->SetBrightObject(true);</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">vesselFilter->SetAlpha(0.5);</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">vesselFilter->SetBeta(0.5);</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">vesselFilter->SetGamma(5.0);</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">vesselFilter->SetObjectDimension(1); // vessels</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<span class="ecxApple-tab-span" style="white-space:pre"><font class="ecxApple-style-span" face="'courier new', monospace">        </font></span></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">hessian->SetHessianToMeasureFilter(vesselFilter);</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<span class="ecxApple-tab-span" style="white-space:pre"><font class="ecxApple-style-span" face="'courier new', monospace">        </font></span></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">try {</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace"><span class="ecxApple-style-span" style="white-space:pre"> </span>hessian->Update();</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">} catch (const itk::ExceptionObject& e) {</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace"><span class="ecxApple-style-span" style="white-space:pre"> </span>std::cerr << __FUNCTION__ << ": itk::ExceptionObject caught: " << e.what() </font><span class="ecxApple-style-span" style="font-family:'courier new', monospace"><< '\n';</span></blockquote>
<blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace"><span class="ecxApple-style-span" style="white-space:pre"> </span>return eErrorITKExceptionRunningSegmentation;</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">} catch (...) {</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace"><span class="ecxApple-style-span" style="white-space:pre"> </span>std::cerr << __FUNCTION__ << ": '...' exception caught.\n";</font></blockquote>
<blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace"><span class="ecxApple-style-span" style="white-space:pre"> </span>return eErrorUnknownExceptionStartingSegmentation;</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">}</font></blockquote><blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">spy::WriteFile<F1d3ITKImgType></font><span class="ecxApple-style-span" style="font-family:'courier new', monospace">(__FUNCTION__, "Vesselness.mhd", *(hessian->GetOutput()), true);</span></blockquote>
<blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">spy::WriteFile<F1d3ITKImgType></font><font class="ecxApple-style-span" face="'courier new', monospace">(__FUNCTION__, "Scales.mhd", *(hessian->GetScalesOutput()), true);</font></blockquote>
<blockquote class="ecxgmail_quote" style="margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font class="ecxApple-style-span" face="'courier new', monospace">spy::WriteFile<F1d3ITKImgType></font><span class="ecxApple-style-span" style="font-family:'courier new', monospace">(__FUNCTION__, "Converted2Float.mhd", *(cast2float->GetOutput()), true);</span></blockquote>
</div><div><br></div><div>The two first images written to disk are empty. Correct size and spacing but only black voxels. Converted2Float.mhd seems to be correcttly converted</div><div>Thanks in advance<br>-- <br>Sergio Vera<br>
<br> Alma IT Systems<br> C/ Vilana, 4B, 4º 1ª<br> 08022 Barcelona<br> T. (+34) 932 380 592<br> <a href="http://www.alma3d.com" target="_blank">www.alma3d.com</a><br>
</div>
<br>_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html
Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users</div></div>
                                           </body>
</html>