<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>We have two options:</div><div><br></div><div>1) break it and maybe it is just fine</div><div>2) make a second method like</div><div><br></div><div>public ImgPlus< T > wrapImgPlus( final ImagePlus imp )</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Img< T > img = wrap( imp );</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ImgPlus< T > imgplus = new ImgPlus( img );</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>imgplus.setCalibration( imp.getCal ... );</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>imgplus.setName( imp.getTitle() );</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return imgplus;</div><div>}</div><div><br></div><div>Maybe 1) is the better way to go, I just wanted to bring up potential implications ....</div><div><br></div><div><br></div><br><div><div>On Jul 12, 2012, at 17:14 , Jean-Yves Tinevez wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
<div bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 12-Jul-12 23:05, Stephan Preibisch
wrote:<br>
</div>
<blockquote cite="mid:BACD9340-4397-4CD5-954A-CC6D091ECEF1@mpi-cbg.de" type="cite">In principle, I agree. However it might break some
code in a bad way. We used several times constructs like
<div><br>
</div>
<div>Img< T > img;</div>
<div><br>
</div>
<div>if ( img instanceOf ImagePlusImg )</div>
<div>{</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>//
get the underlying instance (which is especially true after
wrapping)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>ImagePlus
imp = ((ImagePlusImg)img).getImagePlus();</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>....</div>
<div><br>
</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>//
or do something else where you test instanceof</div>
<div>}<br>
<div><br>
</div>
<div>which would suddenly fail because ImgPlus is an Img, but
only HAS for example an ImagePlusImg...</div>
<div><br>
</div>
<div>What do you think?</div>
</div>
</blockquote>
<br>
Bummer.<br>
<br>
How do we get the ImagePlusAdapter to return an Img that captures
calibration as well then?<br>
</div><div><br class="webkit-block-placeholder"></div>
-- <br>
Please avoid top-posting, and please make sure to reply-to-all!<br>
<br>
Mailing list web interface: <a href="http://groups.google.com/group/fiji-devel">http://groups.google.com/group/fiji-devel</a><br>
</blockquote></div><br></body></html>