<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor=white lang=DE link=blue vlink=purple>
<div class=WordSection1>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Hi Lee,<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I did that already in
all imglib2-core classes. The question also is if it is necessary somewhere
else, too….<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Nice greetings,<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Steffi<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'>From:</span></b><span lang=EN-US
style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>
imagej-devel-bounces@imagejdev.org [mailto:imagej-devel-bounces@imagejdev.org] <b>On
Behalf Of </b>Lee Kamentsky<br>
<b>Sent:</b> Friday, May 20, 2011 2:15 PM<br>
<b>To:</b> imagej-devel@imagejdev.org<br>
<b>Subject:</b> Re: [ImageJ-devel] Changes to the Interval and RealInterval
interfaces<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Makes perfect sense, especially if you've updated all
implementers of the interfaces.<br>
<br>
--Lee<br>
On 5/20/2011 8:09 AM, Stephan Preibisch wrote: <o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>Hi guys,</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>I am just implementing algorithms and I
noticed that it saves quite some temporary arrays if Interval and RealInterval can
set Positionables to their min and max location.</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>The interface would look like (red just
added):</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:Consolas'>
</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F5FBF'>/**</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> * </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> * </span><b><span
style='font-size:10.0pt;font-family:Consolas;color:#7F9FBF'>@param</span></b><span
style='font-size:10.0pt;font-family:Consolas;color:#3F5FBF'> d dimension</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> * </span><b><span
style='font-size:10.0pt;font-family:Consolas;color:#7F9FBF'>@return</span></b><span
style='font-size:10.0pt;font-family:Consolas;color:#3F5FBF'> minimum</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> */</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:Consolas'>
</span><b><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:Consolas'> </span><b><span lang=EN-US style='font-size:10.0pt;
font-family:Consolas;color:#7F0055'>long</span></b><span lang=EN-US
style='font-size:10.0pt;font-family:Consolas'> min( </span><b><span lang=EN-US
style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>final</span></b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas'> </span><b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>int</span></b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas'> d );</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas'>
</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas'>
</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'>/**</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> * Write the minimum
of each dimension into long[].</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> * </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> * </span><b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#7F9FBF'>@param</span></b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#3F5FBF'> min</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> */</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas'>
</span><b><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:Consolas'> </span><b><span lang=EN-US style='font-size:10.0pt;
font-family:Consolas;color:#7F0055'>void</span></b><span lang=EN-US
style='font-size:10.0pt;font-family:Consolas'> min( </span><b><span lang=EN-US
style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>long</span></b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas'>[] min );</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas'>
</span><o:p></o:p></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
Consolas;color:red'> /**</span></b><o:p></o:p></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
Consolas;color:red'> * Sets a {@link
Positionable} to the minimum of this {@link Interval}</span></b><o:p></o:p></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
Consolas;color:red'> * </span></b><o:p></o:p></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
Consolas;color:red'> * @param min</span></b><o:p></o:p></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
Consolas;color:red'> */</span></b><o:p></o:p></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
Consolas;color:red'> public void min(
Positionable min );</span></b><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas'>
</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas'>
</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F5FBF'>/**</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> * </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> </span><span lang=EN-US
style='font-size:10.0pt;font-family:Consolas;color:#3F5FBF'> * </span><b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#7F9FBF'>@param</span></b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#3F5FBF'> d
dimension</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> * </span><b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#7F9FBF'>@return</span></b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#3F5FBF'> maximum</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> */</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas'>
</span><b><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:Consolas'> </span><b><span lang=EN-US style='font-size:10.0pt;
font-family:Consolas;color:#7F0055'>long</span></b><span lang=EN-US
style='font-size:10.0pt;font-family:Consolas'> max( </span><b><span lang=EN-US
style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>final</span></b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas'> </span><b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>int</span></b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas'> d );</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas'>
</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas'>
</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'>/**</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> * Write the minimum
of each dimension into long[].</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> * </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> * </span><b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#7F9FBF'>@param</span></b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#3F5FBF'> max</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> */</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas'>
</span><b><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:Consolas'> </span><b><span lang=EN-US style='font-size:10.0pt;
font-family:Consolas;color:#7F0055'>void</span></b><span lang=EN-US
style='font-size:10.0pt;font-family:Consolas'> max( </span><b><span lang=EN-US
style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>long</span></b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas'>[] max );</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas'> </span><o:p></o:p></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
Consolas;color:red'> /**</span></b><o:p></o:p></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
Consolas;color:red'> * Sets a {@link
Positionable} to the maximum of this {@link Interval}</span></b><o:p></o:p></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
Consolas;color:red'> * </span></b><o:p></o:p></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
Consolas;color:red'> * @param max</span></b><o:p></o:p></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
Consolas;color:red'> */</span></b><o:p></o:p></p>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
Consolas;color:red'> public void max(
Positionable max );</span></b><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas'>
</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas'>
</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'>/**</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> * Write the number of
pixels in each dimension into long[].</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> * </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> * </span><b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#7F9FBF'>@param</span></b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#3F5FBF'>
dimensions</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> */</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas'>
</span><b><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:Consolas'> </span><b><span lang=EN-US style='font-size:10.0pt;
font-family:Consolas;color:#7F0055'>void</span></b><span lang=EN-US
style='font-size:10.0pt;font-family:Consolas'> dimensions( </span><b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>long</span></b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas'>[] dimensions );</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas'>
</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas'>
</span><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'>/**</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> * Get the number of
pixels in a given dimension </span><span lang=EN-US style='font-size:10.0pt;
font-family:Consolas;color:#7F7F9F'><em></span><span lang=EN-US
style='font-size:10.0pt;font-family:Consolas;color:#3F5FBF'>d</span><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#7F7F9F'></em></span><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#3F5FBF'>.</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> * </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> * </span><b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#7F9FBF'>@param</span></b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#3F5FBF'> d</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#3F5FBF'> */</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:Consolas'>
</span><b><span lang=EN-US style='font-size:10.0pt;font-family:Consolas;
color:#7F0055'>public</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:Consolas'> </span><b><span lang=EN-US style='font-size:10.0pt;
font-family:Consolas;color:#7F0055'>long</span></b><span lang=EN-US
style='font-size:10.0pt;font-family:Consolas'> dimension( </span><b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>int</span></b><span
lang=EN-US style='font-size:10.0pt;font-family:Consolas'> d );</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>Same applies to the RealInterval….</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>Now you could write:</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>interval.min( randomAccess );</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>instead of:</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>long[] tmp = new long[ numDimensions ];</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>interval.min( tmp );</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>randomAccess.setPosition( tmp );</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>or</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>for ( int d = 0; d < numDimensions; ++d )</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> randomAccess.setPosition(
interval.min( d ), d );</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>which might be inefficient for the case that
the input is a paged/compressed cell container. Potentially, it would have to
load a lot of unnecessary cells on its way through the dimensions…</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>What do you think? Everything is already
implemented and updated, I simply have to push it….</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>Steffi</span><o:p></o:p></p>
<pre><o:p> </o:p></pre><pre><o:p> </o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>ImageJ-devel mailing list<o:p></o:p></pre><pre><a
href="mailto:ImageJ-devel@imagejdev.org">ImageJ-devel@imagejdev.org</a><o:p></o:p></pre><pre><a
href="http://imagejdev.org/mailman/listinfo/imagej-devel">http://imagejdev.org/mailman/listinfo/imagej-devel</a><o:p></o:p></pre>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p> </o:p></span></p>
</div>
</body>
</html>