[Insight-developers] strange results with python wrapper

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Mon Apr 18 13:18:03 EDT 2005


Hi,

I have a strange and non reproducible result with a python script in which I 
try to implement a simple white top hat. The resulting image have some out of 
normal range pixels, and those pixels are not always at the same position, 
and haven't got the same value.
I try to execute my script on 2 computers (running linux) with the same 
result.
Here is an example of maximum and minimum values I get in the final image with 
different types and difference filters :
[glehmann at pcconf5 pitk]$ python 
WhiteTopHatFilter.py /usr/share/itk-data/Baseline/Filtering/MedianImageFilter.png
modules loaded
<itk class type itk.SubtractImageFilter<US2US2US2>>
2 230
2 230
2 230
0 65535
<itk class type itk.SubtractImageFilter<F2F2F2>>
2.0 230.0
2.0 230.0
2.0 230.0
-146.0 147.0
<itk class type itk.ConstrainedValueDifferenceImageFilter<US2US2US2>>
2 231
2 231
3 231
0 188
<itk class type itk.ConstrainedValueDifferenceImageFilter<F2F2F2>>
2.0 230.0
2.0 230.0
2.0 230.0
1.17549435082e-38 147.0

A second run gives :
[glehmann at pcconf5 pitk]$ python 
WhiteTopHatFilter.py /usr/share/itk-data/Baseline/Filtering/MedianImageFilter.png
modules loaded
<itk class type itk.SubtractImageFilter<US2US2US2>>
2 230
2 230
2 230
0 65535
<itk class type itk.SubtractImageFilter<F2F2F2>>
2.0 230.0
2.0 230.0
2.0 230.0
-146.0 147.0
<itk class type itk.ConstrainedValueDifferenceImageFilter<US2US2US2>>
2 230
2 230
2 230
0 140
<itk class type itk.ConstrainedValueDifferenceImageFilter<F2F2F2>>
2.0 230.0
2.0 230.0
2.0 230.0
1.17549435082e-38 147.0


I also tried to make the same pipeline in C++, and it works just fine.
The script is attached. It use itk module I have proposed in 
http://www.itk.org/Bug/bug.php?op=show&bugid=1766&pos=0 . The result is the 
same with a pure InsightToolkit, but I have tested only one type.
I have also wrapped missing filters.
I can send files if needed...

I really don't know where I should look to find the problem, so any help is 
very welcome.

Regards,

Gaetan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WhiteTopHatFilter.py
Type: application/x-python
Size: 2061 bytes
Desc: not available
Url : http://www.itk.org/mailman/private/insight-developers/attachments/20050418/180bca7a/WhiteTopHatFilter.bin


More information about the Insight-developers mailing list