<div dir="ltr"><font><font face="verdana,sans-serif">No. After the first image got stuck due to oversize, I cropped it, but that was still too large so I cropped it some more. The spacing (0.5 mm) should be correct for the last (smallest) one.</font></font></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 2, 2013 at 2:49 PM, Miller, James V (GE Global Research) <span dir="ltr"><<a href="mailto:millerjv@ge.com" target="_blank">millerjv@ge.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am assuming these are three images that were resampled to different resolutions with the sCAL information adjusted so the pixel sizes change. Is this correct?<br>
<br>
<br>
Jim Miller<br>
Senior Scientist<br>
GE Research<br>
Interventional and Therapy<br>
<br>
GE imagination at work<br>
<div class="im"><br>
<br>
<br>
On Jan 2, 2013, at 7:24 AM, Dženan Zukić wrote:<br>
<br>
PNG image with sCAL chunk attached.<br>
<br>
<br>
</div><div class="im">On Fri, Dec 21, 2012 at 12:57 AM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a><mailto:<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>>> wrote:<br>
That will be great.<br>
<br>
Happy New Tear,<br>
<br>
Bill<br>
<br>
</div><div class="im">On Thu, Dec 20, 2012 at 5:26 PM, Dženan Zukić <<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a><mailto:<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>>> wrote:<br>
> I do, or can at least make one. I am on vacation until 2nd Jan, but then I<br>
> can supply one.<br>
><br>
</div><div class="im">> On Dec 20, 2012 5:06 PM, "Bill Lorensen" <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a><mailto:<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>>> wrote:<br>
>><br>
>> I think your gerrit patch goes too far. pHYs measure pixel size/aspect<br>
>> ration. sCAL is the proper parameter, but as you pointed out, ITK is<br>
>> not writing out a correct sCAL unit type. Since ITK does not have a<br>
>> concept of unit, I think we just need to repair the output image to<br>
>> specify a valid unit type, which probably should be meters rather than<br>
>> radians.<br>
>><br>
>> I'll modify the patch if you don't mind.<br>
>><br>
>> Also, would you have a small png file that has a valid sCAL component?<br>
>><br>
>> Bill<br>
</div><div class="im">>> On Tue, Dec 11, 2012 at 10:53 AM, Dženan Zukić <<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a><mailto:<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>>> wrote:<br>
>> > It looks like Jim Miller introduced invalid unit usage in fix<br>
>> > 15b9450b61249261d098506d9ff878744768025a from 2003-02-19.<br>
>> ><br>
>> > PNG spec defines meters and radians as allowed units in sCAL chunk, vs<br>
>> > unknown and meters in pHYs chunk. Hence the warning I have been seeing<br>
>> > with<br>
>> > OpenCV and NConvert.<br>
>> ><br>
>> ><br>
</div><div class="im">>> > On Tue, Dec 11, 2012 at 4:03 PM, Dženan Zukić <<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a><mailto:<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>>> wrote:<br>
>> >><br>
>> >> Current behavior is to ignore units, but it does not handle unit<br>
>> >> completely correctly (only handles the extension sCAL for metadata, but<br>
>> >> not<br>
>> >> the standard pHYs metadata).<br>
>> >><br>
>> >> Extending current way would transform 2000 pixels/meter (pixel size 0.5<br>
>> >> mm) into spacing of 0.0005.<br>
>> >><br>
>> >><br>
>> >> On Tue, Dec 11, 2012 at 3:50 PM, Bradley Lowekamp<br>
</div>>> >> <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a><mailto:<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>>><br>
<div class="im">>> >> wrote:<br>
>> >>><br>
>> >>><br>
>> >>> Having very small or very large spacing can have big impact on the<br>
>> >>> numerical stability of derivatives and evolving differential equations<br>
>> >>> such<br>
>> >>> as level-sets or diffusion.<br>
>> >>><br>
>> >>> I think the least surprising thing to the users would be to just keep<br>
>> >>> it<br>
>> >>> the same as to avoid adverse numerical effects. Also this would not<br>
>> >>> change<br>
>> >>> the current behavior, correct?<br>
>> >>><br>
>> >>> Brad<br>
>> >>><br>
</div><div class="im">>> >>> On Dec 11, 2012, at 9:42 AM, Dženan Zukić <<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a><mailto:<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>>> wrote:<br>
>> >>><br>
>> >>> PNG has three following units: meters, radians, and unknown. Currently<br>
>> >>> PNG reader ignores unit, and writes unknown units.<br>
>> >>><br>
>> >>> I guess I Should keep writing unknown units. But when reading PNG with<br>
>> >>> meter units (eg. 2000 pixels/meter), should I transform it into pixel<br>
>> >>> spacing 0.5 (assuming customary millimeter) or into 0.0005?<br>
>> >>><br>
>> >>><br>
>> >>> On Tue, Dec 11, 2012 at 3:36 PM, Bill Lorensen<br>
</div>>> >>> <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a><mailto:<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>>><br>
<div class="im">>> >>> wrote:<br>
>> >>>><br>
>> >>>> No units. ITK considers units an application thing. You can add a<br>
>> >>>> unit<br>
>> >>>> type if the format supports it. It could help applications. For<br>
>> >>>> example, most medical images use mm's.<br>
>> >>>><br>
</div>>> >>>> On Tue, Dec 11, 2012 at 8:25 AM, Dženan Zukić <<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a><mailto:<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>>><br>
<div class="im">>> >>>> wrote:<br>
>> >>>> > Is ITK still assuming no units, or millimeters are units for pixel<br>
>> >>>> > spacing?<br>
>> >>>> ><br>
>> >>>> ><br>
>> >>>> > On Mon, Dec 10, 2012 at 5:25 PM, Bill Lorensen<br>
</div>>> >>>> > <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a><mailto:<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>>><br>
<div class="im">>> >>>> > wrote:<br>
>> >>>> >><br>
>> >>>> >> If you submit a gerrit patch, I'll write or modify a test.<br>
>> >>>> >><br>
>> >>>> >> How will we know if the fix works unless we test it? How will we<br>
>> >>>> >> know<br>
>> >>>> >> if someone reintroduces the bug if we don't test it?<br>
>> >>>> >><br>
>> >>>> >><br>
</div>>> >>>> >> On Mon, Dec 10, 2012 at 10:41 AM, Dženan Zukić <<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a><mailto:<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>>><br>
<div class="im">>> >>>> >> wrote:<br>
>> >>>> >> > But this would be a bug fix, not a patch introducing new<br>
>> >>>> >> > features.<br>
>> >>>> >> > This<br>
>> >>>> >> > should already be working, and ideally having a test.<br>
>> >>>> >> ><br>
>> >>>> >> > I know that many bugs don't get fixed, because they are not<br>
>> >>>> >> > important<br>
>> >>>> >> > enough<br>
>> >>>> >> > and there is not enough people working on ITK. However a<br>
>> >>>> >> > requirement to<br>
>> >>>> >> > write a 20-30 line test for a few lines of fixed code is a great<br>
>> >>>> >> > deterrence<br>
>> >>>> >> > for me to contribute bug fixes (such as this one).<br>
>> >>>> >> ><br>
>> >>>> >> ><br>
>> >>>> >> > On Mon, Dec 10, 2012 at 4:26 PM, Bill Lorensen<br>
</div>>> >>>> >> > <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a><mailto:<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>>><br>
<div class="im">>> >>>> >> > wrote:<br>
>> >>>> >> >><br>
>> >>>> >> >> Looks like ti should be fixed. But if you submit a gerrit<br>
>> >>>> >> >> patch,<br>
>> >>>> >> >> make<br>
>> >>>> >> >> sure oyu also supply a test or modify an existing test.<br>
>> >>>> >> >><br>
>> >>>> >> >> The lack of a test is why your previous gerrit patch has not<br>
>> >>>> >> >> been<br>
>> >>>> >> >> approved.<br>
>> >>>> >> >><br>
>> >>>> >> >> Bill<br>
>> >>>> >> >><br>
>> >>>> >> >> On Mon, Dec 10, 2012 at 8:35 AM, Dženan Zukić<br>
</div>>> >>>> >> >> <<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a><mailto:<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>>><br>
<div><div class="h5">>> >>>> >> >> wrote:<br>
>> >>>> >> >> > Hi everyone,<br>
>> >>>> >> >> ><br>
>> >>>> >> >> > I have noticed that ImageFileWriter, when writing png format,<br>
>> >>>> >> >> > writes<br>
>> >>>> >> >> > wrong<br>
>> >>>> >> >> > pixel size information. It is not completely wrong, but it is<br>
>> >>>> >> >> > not in<br>
>> >>>> >> >> > accordance with png specification.<br>
>> >>>> >> >> ><br>
>> >>>> >> >> > When reading such files with OpenCV, I get following warning:<br>
>> >>>> >> >> > libpng warning: Invalid sCAL ignored: invalid unit<br>
>> >>>> >> >> > This is not just annoying and clutter-causing, but displaying<br>
>> >>>> >> >> > it<br>
>> >>>> >> >> > for<br>
>> >>>> >> >> > every<br>
>> >>>> >> >> > single image slows down my OpenCV processing.<br>
>> >>>> >> >> ><br>
>> >>>> >> >> > I used XnView to batch-edit the extracted slices and set some<br>
>> >>>> >> >> > scaling<br>
>> >>>> >> >> > which<br>
>> >>>> >> >> > adheres to the specification to get rid of this warning.<br>
>> >>>> >> >> ><br>
>> >>>> >> >> > Now the question: should I correct this bug, or submit a bug<br>
>> >>>> >> >> > report?<br>
>> >>>> >> >> > My<br>
>> >>>> >> >> > last<br>
>> >>>> >> >> > bug-fixing ended non-gloriously :(<br>
>> >>>> >> >> ><br>
>> >>>> >> >> > _____________________________________<br>
</div></div>>> >>>> >> >> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><<a href="http://www.kitware.com/" target="_blank">http://www.kitware.com/</a>><br>
<div class="im">>> >>>> >> >> ><br>
>> >>>> >> >> > Visit other Kitware open-source projects at<br>
>> >>>> >> >> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>> >>>> >> >> ><br>
>> >>>> >> >> > Kitware offers ITK Training Courses, for more information<br>
>> >>>> >> >> > visit:<br>
>> >>>> >> >> > <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
>> >>>> >> >> ><br>
>> >>>> >> >> > Please keep messages on-topic and check the ITK FAQ at:<br>
>> >>>> >> >> > <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
>> >>>> >> >> ><br>
>> >>>> >> >> > Follow this link to subscribe/unsubscribe:<br>
>> >>>> >> >> > <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
>> >>>> >> >> ><br>
>> >>>> >> >><br>
>> >>>> >> >><br>
>> >>>> >> >><br>
>> >>>> >> >> --<br>
>> >>>> >> >> Unpaid intern in BillsBasement at noware dot com<br>
>> >>>> >> ><br>
>> >>>> >> ><br>
>> >>>> >><br>
>> >>>> >><br>
>> >>>> >><br>
>> >>>> >> --<br>
>> >>>> >> Unpaid intern in BillsBasement at noware dot com<br>
>> >>>> ><br>
>> >>>> ><br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> --<br>
>> >>>> Unpaid intern in BillsBasement at noware dot com<br>
>> >>><br>
>> >>><br>
>> >>> _____________________________________<br>
</div>>> >>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><<a href="http://www.kitware.com/" target="_blank">http://www.kitware.com/</a>><br>
<div class="im">>> >>><br>
>> >>> Visit other Kitware open-source projects at<br>
>> >>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>> >>><br>
>> >>> Kitware offers ITK Training Courses, for more information visit:<br>
>> >>> <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
>> >>><br>
>> >>> Please keep messages on-topic and check the ITK FAQ at:<br>
>> >>> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
>> >>><br>
>> >>> Follow this link to subscribe/unsubscribe:<br>
>> >>> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
>> >>><br>
>> >>><br>
>> >><br>
>> ><br>
>><br>
>><br>
>><br>
>> --<br>
>> Unpaid intern in BillsBasement at noware dot com<br>
<br>
<br>
<br>
--<br>
Unpaid intern in BillsBasement at noware dot com<br>
<br>
</div><sCAL.png><br>
<br>
</blockquote></div><br></div>