Hello again<div><br></div><div>I found the problem to be in line 0. The Hessian Matrix must be double for the Sato filter to work via <span style="font-family: arial, helvetica, sans-serif; ">S</span><font face="arial, helvetica, sans-serif">etHessianToMeasureFilter. I used float in order to save memory but it seems that it has to be double.</font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif">Hope this helps anyone in the future.</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">Regards</font></div>
<div><font face="arial, helvetica, sans-serif"></font><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font><br><div class="gmail_quote">On Mon, Feb 21, 2011 at 11:17 AM, Sergio Vera <span dir="ltr"><<a href="mailto:sergio.vera@alma3d.com">sergio.vera@alma3d.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello all<div><br></div><div>I've been able to use MultiScaleHessianBasedMeasureImageFilter with <font face="arial, helvetica, sans-serif">HessianToObjectnessMeasureImageFilter (Frangi vesselness), but I'm unable to use it with Sato Vesselness (Hessian3DToVesselnessMeasureImageFilter)</font></div>
<div><font face="arial, helvetica, sans-serif">From the original article of the Insight Journal (</font><a href="http://www.insight-journal.org/browse/publication/175" target="_blank">http://www.insight-journal.org/browse/publication/175</a><span style="font-family:arial, helvetica, sans-serif">), it seems that this sould be possible but trying to use the same code results in</span> compilation errors, here is the snippet of the code although it seems that the filter has been slightly modified after bein introduced to itk:</div>
<div><br></div><div><div><font face="'courier new', monospace">0: typedef itk::SymmetricSecondRankTensor<float, 3> HessianPixelType;</font></div><div><font face="'courier new', monospace">1: typedef itk::Image<HessianPixelType, 3> HessianImage;</font></div>
</div><div><font face="'courier new', monospace">2: typedef itk::Image<float,3> FloatImage;</font></div><div><div><font face="'courier new', monospace">3: typedef itk::MultiScaleHessianBasedMeasureImageFilter<FloatImage, HessianImage, FloatImage> MultiScaleEnhancementFilterType;</font></div>
</div><div><font face="'courier new', monospace">4: typedef itk::Hessian3DToVesselnessMeasureImageFilter<float> SatoVesselness;</font></div><div><div><font face="'courier new', monospace">5: MultiScaleEnhancementFilterType::Pointer multiScaleEnhancementFilter = MultiScaleEnhancementFilterType::New();</font></div>
<div><font face="'courier new', monospace">6: multiScaleEnhancementFilter->SetInput(inputImg);</font></div></div><div><font face="'courier new', monospace"><br>
</font></div><div><div><font face="'courier new', monospace">7: SatoVesselness* vesselnessFilter = multiScaleEnhancementFilter->GetHessianToMeasureFilter();</font></div><div><font face="'courier new', monospace">8: vesselnessFilter->SetAlpha1(0.5);</font></div>
<div><font face="'courier new', monospace">9: vesselnessFilter->SetAlpha2(0.5);</font></div></div><div><div><font face="'courier new', monospace">10: multiScaleEnhancementFilter->SetSigmaStepMethodToLogarithmic();</font></div>
<div><font face="'courier new', monospace">11: multiScaleEnhancementFilter->GenerateScalesOutputOn();</font></div></div><div><div><font face="'courier new', monospace">12: multiScaleEnhancementFilter->SetSigmaMinimum(a_minTargetVesselSize);</font></div>
<div><font face="'courier new', monospace">13: multiScaleEnhancementFilter->SetSigmaMaximum(a_maxTargetVesselSize);</font></div><div><font face="'courier new', monospace">14: multiScaleEnhancementFilter->SetNumberOfSigmaSteps(a_sizeSteps);<span style="white-space:pre-wrap">        </span></font></div>
<div><font face="'courier new', monospace">15: multiScaleEnhancementFilter->Update();</font></div></div><div><font face="'courier new', monospace"><br></font></div>
<div><font face="arial, helvetica, sans-serif">This snippet does not compile (line 7):</font></div><div><div><font face="'courier new', monospace">error C2440: 'initializing' : cannot convert from 'itk::ImageToImageFilter<TInputImage,TOutputImage> *' to 'SatoVesselness *'</font></div>
<div><font face="'courier new', monospace">1> with</font></div><div><font face="'courier new', monospace">1> [</font></div><div><font face="'courier new', monospace">1> TInputImage=itk::Image<HessianPixelType,3>,</font></div>
<div><font face="'courier new', monospace">1> TOutputImage=itk::Image<float,3></font></div><div><font face="'courier new', monospace">1> ]</font></div>
<div><font face="'courier new', monospace">1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast</font></div></div><div><font face="'courier new', monospace"><br>
</font></div><div><font face="arial, helvetica, sans-serif">I tried to use reinterpre_cast to no avail... and Hessian3DToVesselness do inherits from ImageToImage. I've also tried to create a ::New() </font><span style="font-family:arial, helvetica, sans-serif">Hessian3DToVesselness and assign to MultiScaleHessian with S</span><font face="arial, helvetica, sans-serif">etHessianToMeasureFilter, but this does not wotk either..</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Any ideas on why this does not work?</font></div><div><br></div>
<div>Regards</div><div>-- <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>
</blockquote></div><br><br clear="all"><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">www.alma3d.com</a><br>
</div>