<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hello,
<div class=""><br class="">
</div>
<div class="">I am sorry to hear that you find SimpleITK “poorly managed”. It is not clear to me what problems you are having to cause that view. SimpleITK is an open source project, if you find some aspect of documentation lacking you are welcomed to help
improve it. Or give specific suggestions, the can be address when resources are available. The current documentation with SimpleITK is not independent of ITK. It requires some knowledge of how ITK works. To that end the “ITK Software Guide” [1] is a useful
resource.</div>
<div class=""><br class="">
</div>
<div class="">The particular problem with the `WriteImage` procedure and keyword argument is due to a bug (or lack of feature) in SWIG. SWIG is used to provide language bindings for all of SimpleITK supported languages. SWIG does not support keyword arguments
with overloaded functions. In this case there are two `WriteImage` methods[2][3], so keywords arguments do not work in Python.</div>
<div class=""><br class="">
</div>
<div class="">The work around is to not use keyword arguments i.e. `sitk.WriteImage(img, “out.mha”, True)` or to use the object oriented interface and set the parameter.</div>
<div class=""><br class="">
</div>
<div class="">Now regarding the question:</div>
<div class="">
<blockquote type="cite" class="">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">
<div class="HOEnZb">
<div class="h5">
<div dir="ltr" class="">
<div class="gmail_quote">
<div dir="ltr" class="">
<div class="">
<div class=""><span name="Dženan Zukić" class="m_-7202426662481680418m_-7473936639335824273gmail-gD">Can u tell me if there will be information loss on conversion to Int16?</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
<div class=""><br class="">
</div>
<div class="">By definition of conversion from float to int16 you are loosing information. The two numeric representations are different sets with different ranges.</div>
<div class=""><br class="">
</div>
<div class="">Is the information loss significant? is it just noise? what magnitude is it? does it have an impact on your processing? These are all questions for you to experiment with and determine.</div>
<div class=""><br class="">
</div>
<div class="">The Cast filter does a raw C++ cast between types [4], which does have some caveats. If the range of the input is problematic then the ClampImageFilter [5] could be used.</div>
<div class=""><br class="">
</div>
<div class="">Hope that helps,</div>
<div class="">Brad</div>
<div class="">
<div class=""><br class="">
</div>
<div class="">[1] <a href="https://itk.org/ITK/help/documentation.html" class="">https://itk.org/ITK/help/documentation.html</a></div>
<div class="">[2] <a href="https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#a26db5ae04c6df98d7b072f03fd435fdd" class="">https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#a26db5ae04c6df98d7b072f03fd435fdd</a></div>
<div class="">[3] <a href="https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#ae67de579bc4b36c11f322af08061f697" class="">https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#ae67de579bc4b36c11f322af08061f697</a></div>
<div class="">[4] <a href="http://www.cplusplus.com/doc/tutorial/typecasting/" class="">http://www.cplusplus.com/doc/tutorial/typecasting/</a></div>
<div class="">[5] <a href="https://itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1ClampImageFilter.html" class="">https://itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1ClampImageFilter.html</a></div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Jan 24, 2017, at 1:28 AM, Vishwanathan Shreyas <<a href="mailto:shreyas122011@gmail.com" class="">shreyas122011@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="">Also, using <span style="font-family:monospace,monospace" class="">
useCompression=True</span> as parameter in SimpleITK.WriteImage() gives:<br class="">
<pre style="box-sizing: border-box; overflow: auto; font-family: monospace; font-size: 14px; display: block; padding: 0px; margin: 0px; line-height: inherit; word-break: break-all; background-color: rgb(255, 255, 255); border-width: 0px; border-style: none; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; white-space: pre-wrap; vertical-align: baseline; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; word-spacing: 0px;" class=""><span class="gmail-ansicyan" style="box-sizing:border-box;color:steelblue"><span class="gmail-ansigreen" style="box-sizing:border-box;color:darkgreen"><span class="gmail-ansired" style="box-sizing:border-box;color:darkred">TypeError</span>: WriteImage() got an unexpected keyword argument 'useCompression'
</span></span></pre>
<br class="gmail-Apple-interchange-newline">
</div>
Though I appreciate the work on SimpleITK, I can't help but say that SimpleITK is very poorly managed.<br class="">
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Tue, Jan 24, 2017 at 11:56 AM, Vishwanathan Shreyas <span dir="ltr" class="">
<<a href="mailto:shreyas122011@gmail.com" target="_blank" class="">shreyas122011@gmail.com</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb">
<div class="h5">
<div dir="ltr" class="">Hi <span name="Dženan Zukić" class="m_-7202426662481680418m_-7473936639335824273gmail-gD">
Džena,</span><br class="">
<span name="Dženan Zukić" class="m_-7202426662481680418m_-7473936639335824273gmail-gD"></span>
<div class="gmail_quote">
<div dir="ltr" class="">
<div class="">
<div class="">
<div class=""><span name="Dženan Zukić" class="m_-7202426662481680418m_-7473936639335824273gmail-gD"><br class="">
</span></div>
<span name="Dženan Zukić" class="m_-7202426662481680418m_-7473936639335824273gmail-gD">Thanks for the advice! Can u tell me if there will be information loss on conversion to Int16?<br class="">
<br class="">
</span></div>
<span name="Dženan Zukić" class="m_-7202426662481680418m_-7473936639335824273gmail-gD">Regards,<br class="">
</span></div>
<span name="Dženan Zukić" class="m_-7202426662481680418m_-7473936639335824273gmail-gD">Shreyas<br class="">
</span></div>
<div class="m_-7202426662481680418HOEnZb">
<div class="m_-7202426662481680418h5">
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Mon, Jan 23, 2017 at 11:20 PM, Dženan Zukić <span dir="ltr" class="">
<<a href="mailto:dzenanz@gmail.com" target="_blank" class="">dzenanz@gmail.com</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr" class="">
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
Hi Shreyas,</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
<br class="">
</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
more likely reason is that you did not turn on compression in the ImageFileWriter. And casting the output back to int16 would decrease the size further.</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
<br class="">
</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
Regards,</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
Dženan</div>
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">
<div class="">
<div class="m_-7202426662481680418m_-7473936639335824273h5">On Mon, Jan 23, 2017 at 11:50 AM, Vishwanathan Shreyas
<span dir="ltr" class=""><<a href="mailto:shreyas122011@gmail.com" target="_blank" class="">shreyas122011@gmail.com</a>></span> wrote:<br class="">
</div>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">
<div class="m_-7202426662481680418m_-7473936639335824273h5">
<div dir="ltr" class="">Hi,<br class="">
<div class="gmail_quote">
<div dir="ltr" class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class=""><br class="">
</div>
I'm using SimpleITK on python. I wanted to perforn N4 bias correction on the MICCAI BRATS database. For that, first I cast the images to Float32, which were initially Int16 and then passed it to the filter.<br class="">
<br class="">
</div>
When I saved the output on disk, I found a huge gap between the input and output sizes.<br class="">
<br class="">
</div>
INPUT: ~2MB<br class="">
</div>
OUPUT: ~33MB !!!<br class="">
<br class="">
</div>
I know that float takes more space, but can we cast the output to Int16 again without loss of information(as I don't believe float pixel values mean anything)?<br class="">
<br class="">
</div>
Thanks,<br class="">
</div>
Shreyas<br class="">
</div>
</div>
<br class="">
</div>
<br class="">
</div>
</div>
______________________________<wbr class="">_________________<br class="">
Community mailing list<br class="">
<a href="mailto:Community@itk.org" target="_blank" class="">Community@itk.org</a><br class="">
<a href="http://public.kitware.com/mailman/listinfo/community" rel="noreferrer" target="_blank" class="">http://public.kitware.com/mail<wbr class="">man/listinfo/community</a><br class="">
<br class="">
</blockquote>
</div>
<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</div>
<br class="">
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
_______________________________________________<br class="">
Community mailing list<br class="">
<a href="mailto:Community@itk.org" class="">Community@itk.org</a><br class="">
http://public.kitware.com/mailman/listinfo/community<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</body>
</html>