[Insight-developers] The Debug Macro Features
Sayan Pathak
spathak@insightful.com
Tue, 18 Dec 2001 14:12:20 -0800
Hi,
I have been entertained by the itkDebugMacro today.
I have a story to tell
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
I was working with the Region Growing code trying to chase a bug. When I
discovered that the several small regions I have, are defined by the
label they have, their area, their mean intensity and the borders
defining these regions. There are several of these in an image set. I
have a simple data set with only 18 regions.
In the old days, when itk did not have the powerful tools like the
itkDebugMacro; I used the std::cout & endl to give me feedback on the
regions. One of the regions looked something like:
------------------------------
Location : 00FF4C28
Label : 1
Area : 4
Mean : 3
Num Borders: 3
++++++++++++++++++++++++++++++
Border Ptr :00FF71D8( 1 - 2 ) (neighbor region 1 - neighbor region 2)
Border Ptr :00FF6C88( 1 - 4 )
Border Ptr :00FF77B0( 1 - 10 )
------------------------------
------------------------------
This looked intuitive and when several of them got printed out I had
little problems sifting through the data.=20
But now we have a fuel injection microprocessor driven car as opposed to
the ones with old carburetor. In other words, I use itkDebugMacro
instead of the std::cout/endl.=20
When using the Debug Macro, I get extensive reporting even for a simple
data set. As an example I have attached below the description of the
same region. The reporting is very detailed indeed. But mostly
redundant. I had a headache after using it a few times and have gone
back to my old means of cout/endl.
I would prefer using the itkDebugMacro as it would be a much slicker way
of doing things. But not the way it is right now. Please let me know if
I could do something to make it easier.
Thanks,
Sayan
-------------------
Debug: In
E:\Insight-clean\Insight\Code\Common\itkKLMSegmentationRegion.cxx, lin
e 412
KLMSegmentationRegion (00FF4C28): ------------------------------
Debug: In
E:\Insight-clean\Insight\Code\Common\itkKLMSegmentationRegion.cxx, lin
e 413
KLMSegmentationRegion (00FF4C28): Location : 00FF4C28
Debug: In E:\Insight-clean\Insight\Code\Common\itkSegmentationRegion.h,
line 100
KLMSegmentationRegion (00FF4C28): returning RegionLabel of 1
Debug: In
E:\Insight-clean\Insight\Code\Common\itkKLMSegmentationRegion.cxx, lin
e 414
KLMSegmentationRegion (00FF4C28): Label : 1
Debug: In E:\Insight-clean\Insight\Code\Common\itkSegmentationRegion.h,
line 104
KLMSegmentationRegion (00FF4C28): returning RegionArea of 4
Debug: In
E:\Insight-clean\Insight\Code\Common\itkKLMSegmentationRegion.cxx, lin
e 415
KLMSegmentationRegion (00FF4C28): Area : 4
Debug: In E:\Insight-clean\Insight\Code\Common\itkSegmentationRegion.h,
line 112
KLMSegmentationRegion (00FF4C28): returning MeanRegionIntensity of 3
Debug: In
E:\Insight-clean\Insight\Code\Common\itkKLMSegmentationRegion.cxx, lin
e 416
KLMSegmentationRegion (00FF4C28): Mean : 3
Debug: In
E:\Insight-clean\Insight\Code\Common\itkKLMSegmentationRegion.cxx, lin
e 417
KLMSegmentationRegion (00FF4C28): Num Borders: 3
Debug: In
E:\Insight-clean\Insight\Code\Common\itkKLMSegmentationRegion.cxx, lin
e 418
KLMSegmentationRegion (00FF4C28): ++++++++++++++++++++++++++++++
Debug: In E:\Insight-clean\Insight\Code\Common\itkSegmentationRegion.h,
line 100
KLMSegmentationRegion (00FF4C28): returning RegionLabel of 1
Debug: In
E:\Insight-clean\Insight\Code\Common\itkKLMSegmentationRegion.cxx, lin
e 428
KLMSegmentationRegion (00FF4C28): Border Ptr :00FF71D8( 1 - 2 )
Debug: In E:\Insight-clean\Insight\Code\Common\itkSegmentationRegion.h,
line 100
KLMSegmentationRegion (00FF4C28): returning RegionLabel of 1
Debug: In
E:\Insight-clean\Insight\Code\Common\itkKLMSegmentationRegion.cxx, lin
e 428
KLMSegmentationRegion (00FF4C28): Border Ptr :00FF6C88( 1 - 4 )
Debug: In E:\Insight-clean\Insight\Code\Common\itkSegmentationRegion.h,
line 100
KLMSegmentationRegion (00FF4C28): returning RegionLabel of 1
Debug: In
E:\Insight-clean\Insight\Code\Common\itkKLMSegmentationRegion.cxx, lin
e 428
KLMSegmentationRegion (00FF4C28): Border Ptr :00FF77B0( 1 - 10 )