Hi Fucang,
thank you for your comment, it is absolutely justified. I changed the
query to the following:
if(image->GetScalarValueMax() == image->GetScalarValue2ndMin()&&
image->GetScalarValueMin() == image->GetScalarValue2ndMax()) // decides
whether the object is a binary
Now both cases - binary presented as 1 and 0 and as 255 and 0 - should
be treated correctly. Committed with revision 16911.
Thanks for your attention!
Best regards,
Sven
Von: Jia Fucang [mailto:[email protected]]
Gesendet: Montag, 20. April 2009 16:48
An: [email protected]
Betreff: [mitk-users] bug binary image determination
Hi,
I noticed that SVN head change mitkImageMapper2D.cpp to determine
an image is binary image or not, but there is a bug in line
if((image->GetScalarValueMax()==1 &&
image->GetScalarValue2ndMax()==0)||(image->GetScalarValueMin()==0 &&
image->GetScalarValue2ndMin()==1) ) // decides whether the object is a
binary
If a dicom image has pixel value 0,1, ..., 1023, 1024. Then the
first part is false
(image->GetScalarValueMax()==1 && image->GetScalarValue2ndMax()==0)
but the second part is true
(image->GetScalarValueMin()==0 && image->GetScalarValue2ndMin()==1)
and wrongly determine it is a binary image.
And usually binary image is not well defined, it usually has two value 0
and 1,
but in fact 0 and 255 are usually used to display images. If the
condition can be
there are two values, one is 0, and the other is 1 or 255, it is a
binary image.
Fucang
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users