<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Wang,<div> how is m_itkHessianImageData defined exactly? Can you post the portion of the code in your .h file and the constructor that shows it?</div><div>Thanks</div><div><br></div><div>Luca</div><div><br></div><div><br><div><div>On Mar 5, 2011, at 9:22 AM, Wang Zhimin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi, Luca,</div><div><br></div><div>I have problem of using Graft() method. I use m_itkHessianImageData->Graft( hessianFilter->GetHessianOutput() ), I got the following error:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 12px; text-indent: -12px; font: normal normal normal 11px/normal Menlo; ">cpp:231: error: passing 'const HessianImageType' as 'this' argument of 'void itk::Image<TPixel, VImageDimension>::Graft(const itk::DataObject*) [with TPixel = itk::SymmetricSecondRankTensor<float, 3u>, unsigned int VImageDimension = 3u]' discards qualifiers</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 12px; text-indent: -12px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 12px; text-indent: -12px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;"><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></span></font></div></div><div>I already instantiated it in constructor. </div><div><br></div><div>If I don't use Graft(), directly assign it as m_itkHessianImageData = hessianFilter->GetHessianOutput(); instead, there is no compiling error. </div><div><br></div><div>The reason why I define it in the class level is that, I want to use this m_itkHessianImageData for some other functions and classes. </div><div><br></div><div>Thank you very much.</div><div><br></div><div>Regards,</div><div>Zhimin</div><div><br></div><br><div><div>On 02-Mar-2011, at 6:11 AM, Luca Antiga wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Wang,<div> you have a problem with const-correctedness: GetHessianOutput returns a const HessianImageType reference, while your m_itkHessianImageData is not const.</div><div><br></div><div>I suggest you use instead</div><div><br></div><div><div>const HessianImageType * hessianImage = hessianFilter->GetHessianOutput();</div></div><div><br></div><div>or, if m_itkHessianImageData is already declared at the class level (as the m_ in the name suggests) and instantiated, e.g., in the constructor, </div><div><br></div><div>m_itkHessianImageData->Graft(hessianFilter->GetHessianOutput());</div><div><br></div><div>Note that for the above to work m_itkHessianImageData must have been instantiated as</div><div><br></div><div>m_itkHessianImageData = HessianImageType::New();</div><div><br></div><div>Hope this helps</div><div><br></div><div>Luca</div><div><br></div><div><br></div><div><br><div><div>On Mar 1, 2011, at 10:32 AM, Wang Zhimin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi, Luca</div><div><br></div><div>Thanks for the reply.</div><div><br></div><div>From what you have written, I think the MultiScaleHessianBasedMeasureImageFilter is the one I am looking for. </div><div><br></div><div>But now when I try to use it to get the Hessian matrix. I got the following compiling errors. </div><div>----------------------------------------------</div><div>In the header file myAlgorithm.h, I declare</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span style="color: #be299d">typedef</span> itk::SymmetricSecondRankTensor< <span style="color: #be299d">float</span>, <span style="color: #2f2fd1">3</span> > HessianPixelType;</div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span style="color: #be299d">typedef</span> itk::Image< HessianPixelType, <span style="color: #2f2fd1">3</span> > HessianImageType;</div></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span style="color: #be299d">typedef</span> itk::MultiScaleHessianBasedMeasureImageFilter< FloatVolumeImageType, HessianImageType, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "> FloatVolumeImageType > MultiScaleHessianFilterType;</div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 132, 35); ">HessianImageType::Pointer m_itkHessianImageData;</div></div><div><br></div>And then, in the myAlgorithm.cpp, I have<div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(77, 129, 134); ">MultiScaleHessianFilterType<span style="color: #000000">::</span><span style="color: #733ea4">Pointer</span><span style="color: #000000"> hessianFilter = </span>MultiScaleHessianFilterType<span style="color: #000000">::</span><span style="color: #401f7d">New</span><span style="color: #000000">();</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>hessianFilter-><span style="color: #401f7d">SetInput</span>( cast2float-><span style="color: #401f7d">GetOutput</span>() );</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>hessianFilter-><span style="color: #401f7d">SetNumberOfSigmaSteps</span>( <span style="color: #2f2fd1">10</span> );</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(64, 31, 125); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span>hessianFilter-></span>SetSigmaStepMethodToEquispaced<span style="color: #000000">();</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>hessianFilter-><span style="color: #401f7d">SetSigmaMinimum</span>( <span style="color: #2f2fd1">0.5</span> );</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>hessianFilter-><span style="color: #401f7d">SetSigmaMaximum</span>( <span style="color: #2f2fd1">4.0</span> );</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(64, 31, 125); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span>hessianFilter-></span>SetGenerateHessianOutput<span style="color: #000000">( </span><span style="color: #be299d">true</span><span style="color: #000000"> );</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(64, 31, 125); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span>hessianFilter-></span>SetGenerateScalesOutput<span style="color: #000000">( </span><span style="color: #be299d">true</span><span style="color: #000000"> );</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-tab-span" style="white-space:pre">        </span></span>m_itkHessianImageData = hessianFilter-><span style="color: #401f7d">GetHessianOutput</span>();</div><div><br></div><div>And I compile, I have the following errors:</div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 12px; text-indent: -12px; font: normal normal normal 11px/normal Menlo; ">/Users/zwang/workspace/myFuzzyVesselSegmentation/VesselSegmentationPanel.cpp:214:0 /Users/zwang/workspace/myFuzzyVesselSegmentation/VesselSegmentationPanel.cpp:214: error: invalid conversion from 'const itk::Image<itk::SymmetricSecondRankTensor<float, 3u>, 3u>*' to 'itk::Image<itk::SymmetricSecondRankTensor<float, 3u>, 3u>*'</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 12px; text-indent: -12px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 12px; text-indent: -12px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 12px; text-indent: -12px; font: normal normal normal 11px/normal Menlo; ">/Users/zwang/workspace/myFuzzyVesselSegmentation/VesselSegmentationPanel.cpp:214:0 /Users/zwang/workspace/myFuzzyVesselSegmentation/VesselSegmentationPanel.cpp:214: error: initializing argument 1 of 'itk::SmartPointer<TObjectType>& itk::SmartPointer<TObjectType>::operator=(TObjectType*) [with TObjectType = itk::Image<itk::SymmetricSecondRankTensor<float, 3u>, 3u>]'</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 12px; text-indent: -12px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 12px; text-indent: -12px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div></div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 132, 35); "><font class="Apple-style-span"><br></font></div><div>May I know what the reason? Or what's the proper way to get the hessian matrix with the itk::MultiscalHessianBasedMeasureImageFilter?</div><div><br></div><div>Regards,</div><div>Zhimin</div><div><br></div><div><br><div><div>On 25-Feb-2011, at 9:22 PM, Luca Antiga wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Zhimin,<div> if you just need to compute the hessian and eigenvectors at a particular scale, you are better off using the HessianRecursiveGaussianImageFilter and manipulate the hessian to get the eigenvectors directly, pretty much in the same way as done in the ThreadedGenerateData method, in Code/Review/itkHessianToObjectnessMeasureImageFilter.txx</div><div><br></div><div>If, on the other hand, you need to perform a multi-scale analysis and then look at the eigenvectors, then using MultiScaleHessianBasedMeasureImageFilter is correct. In that case, the GetHessianOutput method will get you an image where each voxel holds the Hessian at the scale that gave the highest response (in terms of the generic Hessian-based measure you plug in the filter, for instance Sato's vesselness).</div><div><br></div><div>As for accessing the individual values of the Hessian, use the H(0,0), H(1,0), etc signature (see Code/Common/itkSymmetricSecondRankTensor.h). That way you can access all 9 components (except that only 6 will be stored, but that's transparent to you).</div><div><br></div><div>Hope this helps</div><div><br></div><div>Luca</div><div><br></div><div><br><div><div>On Feb 25, 2011, at 9:21 AM, Wang Zhimin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><font class="Apple-style-span" face="'Andale Mono'" size="4"></font><div><font class="Apple-style-span" face="'Andale Mono'" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div><font class="Apple-style-span" face="'Andale Mono'" size="4"><span class="Apple-style-span" style="font-size: 14px;">I am a newbie to ITK. </span></font><span class="Apple-style-span" style="font-family: 'Andale Mono'; font-size: 14px; ">I currently want to compute the hessian matrix, eigen vector out of some volume CT images. I found that I can use itk::MultiScaleHessianBasedMeasureImageFilter, or itk::HessianRecursiveGaussianImageFilter plus itk::SymmetricEigenAnalysis and SymmetricSecondRankTensor image iterator to finish the job. Am I right?</span></div><div><font class="Apple-style-span" face="'Andale Mono'" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div><font class="Apple-style-span" face="'Andale Mono'" size="4"><span class="Apple-style-span" style="font-size: 14px;">For the itk::MultiScaleHessianBasedMeasureImageFilter, I understand that I can turn the GenerateHessianOutputOn() function to compute the Hessian image and use GetHessianOutput() to get the SymmetricSecondRankTensor image. Is this a correct procedure? If yes, so here comes my question. Since the multi scale hessian filter is multi scale, if I use GetHessianOutput() function, what scale is the Hessian output of?</span></font></div><div><font class="Apple-style-span" face="'Andale Mono'" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div><font class="Apple-style-span" face="'Andale Mono'" size="4"><span class="Apple-style-span" style="font-size: 14px;">Suppose my volume image dimension is 3, how can I access all the values in Hessian matrix? Can I use H[][] to access all 9 values? Or I can only access 6 and I need to fill up all the rest based on symmetric rule?</span></font></div><div><font class="Apple-style-span" face="'Andale Mono'" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div><font class="Apple-style-span" face="'Andale Mono'" size="4"><span class="Apple-style-span" style="font-size: 14px;">For my second option, from HessianRecursiveGaussianImageFilter -> SymmetricSecondRankTensor image -> SymmetricEigenAnalysis -> eigen vector, will it work as predicted? </span></font></div><div><font class="Apple-style-span" face="'Andale Mono'" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div><font class="Apple-style-span" face="'Andale Mono'" size="4"><span class="Apple-style-span" style="font-size: 14px;">Sorry for so many questions. </span></font></div><div><font class="Apple-style-span" face="'Andale Mono'" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div><font class="Apple-style-span" face="'Andale Mono'" size="4"><span class="Apple-style-span" style="font-size: 14px;">Thank you and best regards,</span></font></div><div><font class="Apple-style-span" face="'Andale Mono'" size="4"><span class="Apple-style-span" style="font-size: 14px;">Zhimin</span></font></div><div><font class="Apple-style-span" face="'Andale Mono'" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div><font class="Apple-style-span" face="'Andale Mono'" size="4"><span class="Apple-style-span" style="font-size: 14px;">Research Fellow</span></font></div><div><font class="Apple-style-span" face="'Andale Mono'" size="4"><span class="Apple-style-span" style="font-size: 14px;">Institute for Infocomm Research</span></font></div><div><font class="Apple-style-span" face="'Andale Mono'" size="4"><span class="Apple-style-span" style="font-size: 14px;">A-STAR, Singapore</span></font></div><div><font class="Apple-style-span" face="'Andale Mono'" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div><span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; "><br></span></div>
<div>
Institute for Infocomm Research disclaimer: "This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately. Please do not copy or use it for any purpose, or disclose its contents to any other person. Thank you."<br>
</div></div>
_____________________________________<br>Powered by <a href="http://www.kitware.com/">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br><a href="http://www.kitware.com/products/protraining.html">http://www.kitware.com/products/protraining.html</a><br><br>Please keep messages on-topic and check the ITK FAQ at:<br><a href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br></blockquote></div><br></div></div></blockquote></div><br></div></div>
<div>
Institute for Infocomm Research disclaimer: "This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately. Please do not copy or use it for any purpose, or disclose its contents to any other person. Thank you."<br>
</div></div>
</blockquote></div><br></div></div></blockquote></div><br>
<div>
Institute for Infocomm Research disclaimer: "This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately. Please do not copy or use it for any purpose, or disclose its contents to any other person. Thank you."<br>
</div></div>
</blockquote></div><br></div></body></html>