Discussion:
[ITK-users] problem with RelabelComponentImageFilter
Aurelie Le breton
2017-09-28 07:18:40 UTC
Permalink
Hello,

I'm using ITK, and since a few days SimpleITK, and I've got a problem with
the RelabelComponentImageFilter.
I haven't found the way to change the minimum objects size, here is my code
(SimpleITK via Java) :

BigInteger islet_size = BigInteger.valueOf(round(height/5)); // = 102
RelabelComponentImageFilter relabelFilter = new RelabelComponentImageFilter();
relabelFilter.setMinimumObjectSize(islet_size);
BigInteger taille = relabelFilter.getMinimumObjectSize();
System.out.println(taille);
relabelImage[i] = relabelFilter.execute(connectedComponentOutput[i]/*,
islet_size*/);

The size displayed in the terminal is : class org.itk.simple.SimpleITKJNI

and the output image is filled full black.

I don't understand the problem.

Thanks in advance for your help.
Dženan Zukić
2017-09-28 13:33:25 UTC
Permalink
Hi Aurelie,

if you don't call .setMinimumObjectSize(), do you still get an all-black
image? If not, does any of the objects consist of more than 102 pixels?

Regards,
DÅŸenan
Post by Aurelie Le breton
Hello,
I'm using ITK, and since a few days SimpleITK, and I've got a problem with
the RelabelComponentImageFilter.
I haven't found the way to change the minimum objects size, here is my
BigInteger islet_size = BigInteger.valueOf(round(height/5)); // = 102
RelabelComponentImageFilter relabelFilter = new RelabelComponentImageFilter();
relabelFilter.setMinimumObjectSize(islet_size);
BigInteger taille = relabelFilter.getMinimumObjectSize();
System.out.println(taille);
relabelImage[i] = relabelFilter.execute(connectedComponentOutput[i]/*, islet_size*/);
The size displayed in the terminal is : class org.itk.simple.SimpleITKJNI
and the output image is filled full black.
I don't understand the problem.
Thanks in advance for your help.
_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.kitware.com/products/protraining.php
http://www.itk.org/Wiki/ITK_FAQ
http://public.kitware.com/mailman/listinfo/insight-users
Dženan Zukić
2017-09-28 13:35:52 UTC
Permalink
Also, after you call execute, can you call
relabelFilter.GetOriginalNumberOfObjects() and see if this returns non-zero
number?
Post by Dženan Zukić
Hi Aurelie,
if you don't call .setMinimumObjectSize(), do you still get an all-black
image? If not, does any of the objects consist of more than 102 pixels?
Regards,
DÅŸenan
Post by Aurelie Le breton
Hello,
I'm using ITK, and since a few days SimpleITK, and I've got a problem
with the RelabelComponentImageFilter.
I haven't found the way to change the minimum objects size, here is my
BigInteger islet_size = BigInteger.valueOf(round(height/5)); // = 102
RelabelComponentImageFilter relabelFilter = new RelabelComponentImageFilter();
relabelFilter.setMinimumObjectSize(islet_size);
BigInteger taille = relabelFilter.getMinimumObjectSize();
System.out.println(taille);
relabelImage[i] = relabelFilter.execute(connectedComponentOutput[i]/*, islet_size*/);
The size displayed in the terminal is : class org.itk.simple.SimpleITKJNI
and the output image is filled full black.
I don't understand the problem.
Thanks in advance for your help.
_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.kitware.com/products/protraining.php
http://www.itk.org/Wiki/ITK_FAQ
http://public.kitware.com/mailman/listinfo/insight-users
lilipj
2017-09-28 14:39:44 UTC
Permalink
If i don't call setMinimumObjectSize(), all labels are kept, even labels
that contains more than 102 pixels or those that are very small.
That's what i don't understand !!
I can't call GetOriginalNumberOfObjects with SimpleITK, the function doesn't
exists....



--
Sent from: http://itk-users.7.n7.nabble.com/
_____________________________________
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.php

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://public.kitware.com/mailman/listinfo/insight-users
Lowekamp, Bradley (NIH/NLM/LHC) [C]
2017-09-28 14:49:47 UTC
Permalink
Hello,

You initial report said “the output image is filled with black”. It is unclear how you are viewing the image. Perhaps it is just 0’s and 1’s, and you can not see such faint values on the display.

I’d suggest running the LabelStatisticsImageFilter on the results to print the number of labels in the output and their sized. You could also run this on the input too, to get the expected results.

You could also set ` relabelFilter.debugOn()`, this will print the ITK filter’s state before it’s executed, so that you can verify the parameters are correctly set.

The missing GetOriginalNumberOfObjects in SimpleITK is an oversight. Could you please create a feature request on the Github issue tracker[1].

[1] https://github.com/SimpleITK/SimpleITK/issues



On 9/28/17, 10:40 AM, "lilipj" <***@gmail.com> wrote:

If i don't call setMinimumObjectSize(), all labels are kept, even labels
that contains more than 102 pixels or those that are very small.
That's what i don't understand !!
I can't call GetOriginalNumberOfObjects with SimpleITK, the function doesn't
exists....



--
Sent from: http://itk-users.7.n7.nabble.com/
_____________________________________
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.php

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://public.kitware.com/mailman/listinfo/insight-users
_______________________________________________
Community mailing list
***@itk.org
http://public.kitware.com/mailman/listinfo/community


_____________________________________
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.php

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
lilipj
2017-09-28 15:32:30 UTC
Permalink
I've added a MinimumMaximumImageFilter, and it confirms that min = 0.0 and
max = 0.0
and when i run a LabelStatisticsImageFilter, it seems to return 0 label
stat.hasLabel(0) = 1.0
stat.hasLabel(1) = 0.0

if i don't set the minimum size, it returns 207 objects...

I will try to set the debug mode, thanks.



--
Sent from: http://itk-users.7.n7.nabble.com/
_____________________________________
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.php

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://public.kitware.com/mailman/listinfo/insight-users

Loading...