[Insight-users] Streaming I/O

Miller, James V (Research) millerjv@crd.ge.com
Wed, 9 Apr 2003 09:44:50 -0400


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C2FE9E.3193E8A0
Content-Type: text/plain

I wish I could comment on the role of the IORegion in relation to the three
image regions.  Unfortunately, I, like you, are just trying to decipher the
original intent of the IORegion.
 
I think the IORegion is probably okay for reading data.   In this case, the
IORegion indicates what is in the file.  So there little opportunity for
ambiguity.  There is an issue if each slice is in a separate file and you
read a singe slice into a volume, whether the third component of the
IORegion should indicate "what slice".
 
I think the situation is much more difficult when we go to write a file. In
this case, I think the writer should only write the RequestedRegion (which
may match the LargestPossibleRegion).  But in the cases where the
BufferedRegion is larger than the RequestedRegion, then I think the IO
objects and the ImageFileWriter need some additional communication.
 
 
 
 

-----Original Message-----
From: Ron Inbar [mailto:ron@mediguide.co.il]
Sent: Tuesday, April 08, 2003 12:42 PM
To: 'Miller, James V (Research)'; 'Insight-users@public.kitware.com'
Subject: RE: [Insight-users] Streaming I/O



Hi James,

 

Can you please explain the role of the IORegion in relation to the three
Image Regions (Requested, Buffered, and LargestPossible)?

 

So far, my understanding was that the ImageFileWriter should set the
IORegion to the BufferedRegion in order to tell the ImageIO where (on the
disk) to write the contents of the buffer.  For example, if the file format
dictates that each z-slice reside in a separate file, using some consistent
naming scheme, then the ImageIO should use the 3rd dimension of the IORegion
to know which files it has to modify.  It may assume that the data are
contiguous and that the buffer size matches the size of the IORegion.

Likewise, the ImageFileReader should set the IORegion to the RequestedRegion
and allocate a buffer to match this size.  The ImageIO should then use the
IORegion to find the requested data on the disk and place them
(contiguously) into the supplied buffer.

The ImageIO may also need to use the m_Dimensions member to figure out where
the data reside on the disk.

To sum up, I thought the data can be assumed to be contiguous in memory, but
not necessarily on the disk.  

 

Is this not what you had in mind?

 

Ron

 

 

 

-----Original Message-----
From: Miller, James V (Research) [mailto:millerjv@crd.ge.com] 
Sent: Tuesday, April 08, 2003 4:24 PM
To: 'Ron Inbar'; 'Insight-users@public.kitware.com'
Subject: RE: [Insight-users] Streaming I/O

 

This is a problem with out current IO structure. In my opinion, the region
that should be written to disk should be the RequestedRegion (or at worst
the BufferedRegion).  Having it set to the LargestPossibleRegion is a
problem because you do not know whether the pipeline actually gave you a
buffer that contains the LargestPossibleRegion.

 

I think there is a level of communication that is missing between the
FileWrite/FileReader and the IO objects.  From what I can deduce from the
code, the IO objects assume that the IORegion maps to a contiguous block of 

memory in a buffer.  The pipeline mechanism doesn't necessarily ensure that
is the case.  The only region that is contiguous in memory is the
BufferedRegion.  So we either have to stick with this assumption and be
forced to copy the RequestedRegion to a contiguous block of memory sometimes
or we need expand the IO objects to understand

that the IORegion is only a piece of a bigger buffer.

 

I believe you had another streaming question as well.  A few months ago, I
added methods to the IO objects

CanStreamRead()/CanStreamWrite().  The current IO objects always return
false for these methods because

they do not support streaming.  When we have an IO object that supports
streaming, they will need to respond

true to these methods. I think I put a call to CanStreamRead() in
ImageFileReader but I am not sure I put a corresponding call in
ImageFileWriter.  I look into that.

 

Jim

 

 

-----Original Message-----
From: Ron Inbar [mailto:ron@mediguide.co.il]
Sent: Tuesday, April 08, 2003 6:32 AM
To: 'Insight-users@public.kitware.com'
Subject: [Insight-users] Streaming I/O

In the course of my efforts to implement an ImageIO subclass that supports
streaming, I came across the following code segment (in
itkImageFileWriter.txx):

 

template <class TInputImage>

void 

ImageFileWriter<TInputImage>

::Write(void)

{

  // . . .

 

  // Make sure region is within the image, crop if necessary

  ImageIORegion ioRegion(TInputImage::ImageDimension);

  ImageRegion<TInputImage::ImageDimension> region = 

        input->GetLargestPossibleRegion();

  const double *spacing = input->GetSpacing();

  const double *origin = input->GetOrigin();

 

  m_ImageIO->SetNumberOfDimensions(TInputImage::ImageDimension);

  for(unsigned int i=0; i<TInputImage::ImageDimension; i++)

    {

    ioRegion.SetSize(i,region.GetSize(i));

    ioRegion.SetIndex(i,region.GetIndex(i));

    m_ImageIO->SetDimensions(i,region.GetSize(i));

    m_ImageIO->SetSpacing(i,spacing[i]);

    m_ImageIO->SetOrigin(i,origin[i]);

    }

  itkDebugMacro( <<"Region to write = " << ioRegion );

  this->Write(ioRegion);        

}

 

My question is: why does it set the ioRegion to the LargestPossibleRegion
and not to the BufferedRegion?

(I tried to change it and on first inspection it seems to work OK with the
BufferedRegion).

 

Ron

 

 

 

This e-mail message has been sent by MediGuide

and is for the use of the intended recipients only.
The message may contain privileged or confidential information .
If you are not the intended recipient you are hereby notified that any use,
distribution or copying of this communication is strictly prohibited,
and you are requested to delete the e-mail and any attachments

and notify the sender immediately.

 
 
This e-mail message has been sent by MediGuide
and is for the use of the intended recipients only.
The message may contain privileged or confidential information .
If you are not the intended recipient you are hereby notified that any use,
distribution or copying of this communication is strictly prohibited,
and you are requested to delete the e-mail and any attachments
and notify the sender immediately.


------_=_NextPart_001_01C2FE9E.3193E8A0
Content-Type: text/html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">


<META content="MSHTML 6.00.2715.400" name=GENERATOR>
<STYLE>@font-face {
	font-family: Tahoma;
}
@page Section1 {size: 612.0pt 792.0pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; }
P.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
	COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
	COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
	COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
	COLOR: purple; TEXT-DECORATION: underline
}
SPAN.emailstyle17 {
	COLOR: windowtext; FONT-FAMILY: Arial
}
SPAN.EmailStyle19 {
	COLOR: navy; FONT-FAMILY: Arial
}
DIV.Section1 {
	page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV><SPAN class=591473713-09042003><FONT color=#0000ff size=2>I wish I could 
comment on the role of the IORegion in relation to the three image 
regions.&nbsp; Unfortunately, </FONT></SPAN><SPAN class=591473713-09042003><FONT 
color=#0000ff size=2>I, like you, are just trying to decipher the original 
intent of the IORegion.</FONT></SPAN></DIV>
<DIV><SPAN class=591473713-09042003><FONT color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=591473713-09042003><FONT color=#0000ff size=2>I think the 
IORegion is probably okay for reading data.&nbsp;&nbsp; In this case, the 
IORegion indicates what is in the file.&nbsp; So there little opportunity for 
ambiguity.&nbsp; There is an issue if each slice is in a separate file and you 
read a singe slice into a volume, whether the third component of the IORegion 
should indicate "what slice".</FONT></SPAN></DIV>
<DIV><SPAN class=591473713-09042003><FONT color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=591473713-09042003><FONT color=#0000ff size=2>I think the 
situation is much more difficult when we go to write a file. In this case, I 
think the writer should only write the RequestedRegion (which may match the 
LargestPossibleRegion).&nbsp; But in the cases where the BufferedRegion is 
larger than the RequestedRegion, then I think the IO objects and the 
ImageFileWriter need some additional communication.</FONT></SPAN></DIV>
<DIV><SPAN class=591473713-09042003><FONT color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=591473713-09042003></SPAN>&nbsp;</DIV>
<DIV><SPAN class=591473713-09042003><FONT color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=591473713-09042003><FONT color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> Ron Inbar 
  [mailto:ron@mediguide.co.il]<BR><B>Sent:</B> Tuesday, April 08, 2003 12:42 
  PM<BR><B>To:</B> 'Miller, James V (Research)'; 
  'Insight-users@public.kitware.com'<BR><B>Subject:</B> RE: [Insight-users] 
  Streaming I/O<BR><BR></FONT></DIV>
  <DIV class=Section1>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Hi 
  James,</SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Can you please 
  explain the role of the IORegion in relation to the three Image Regions 
  (Requested, Buffered, and LargestPossible)?</SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">So far, my 
  understanding was that the ImageFileWriter should set the IORegion to the 
  BufferedRegion in order to tell the ImageIO where (on the disk) to write the 
  contents of the buffer.&nbsp; For example, if the file format dictates that 
  each z-slice reside in a separate file, using some consistent naming scheme, 
  then the ImageIO should use the 3<SUP>rd</SUP> dimension of the IORegion to 
  know which files it has to modify.&nbsp; It may assume that the data are 
  contiguous and that the buffer size matches the size of the 
  IORegion.</SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Likewise, the 
  ImageFileReader should set the IORegion to the RequestedRegion and allocate a 
  buffer to match this size.&nbsp; The ImageIO should then use the IORegion to 
  find the requested data on the disk and place them (contiguously) into the 
  supplied buffer.</SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">The ImageIO may also 
  need to use the m_Dimensions member to figure out where the data reside on the 
  disk.</SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">To sum up, I thought 
  the data can be assumed to be contiguous in memory, but not necessarily on the 
  disk.&nbsp; </SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Is this not what you 
  had in mind?</SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Ron</SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
  <DIV 
  style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none">
  <P class=MsoNormal><FONT face=Tahoma size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original 
  Message-----<BR><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Miller, 
  James V (Research) [mailto:millerjv@crd.ge.com] <BR><B><SPAN 
  style="FONT-WEIGHT: bold">Sent:</SPAN></B> Tuesday, April 08, 2003 4:24 
  PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> 'Ron Inbar'; 
  'Insight-users@public.kitware.com'<BR><B><SPAN 
  style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [Insight-users] Streaming 
  I/O</SPAN></FONT></P>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" color=blue size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: blue">This is a problem with out current IO 
  structure. In my opinion, the region that should be written to disk should be 
  the RequestedRegion (or at worst the BufferedRegion).&nbsp; Having it set to 
  the LargestPossibleRegion is a problem because you do not know whether the 
  pipeline actually gave you a buffer that contains the 
  LargestPossibleRegion.</SPAN></FONT></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" color=blue size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: blue">I think there is a level of communication 
  that is missing between the FileWrite/FileReader and the IO objects.&nbsp; 
  From what I can deduce from the code, the IO objects assume that the IORegion 
  maps to a contiguous block of </SPAN></FONT></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" color=blue size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: blue">memory in a buffer.&nbsp; The pipeline 
  mechanism doesn't necessarily ensure that is the case.&nbsp; The 
  only&nbsp;region that is contiguous in memory is the BufferedRegion.&nbsp; So 
  we either have to stick with this assumption and be forced to copy the 
  RequestedRegion to a contiguous block of memory sometimes or we need expand 
  the IO objects to understand</SPAN></FONT></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" color=blue size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: blue">that the IORegion is only a piece of a 
  bigger buffer.</SPAN></FONT></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" color=blue size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: blue">I believe you had another streaming 
  question as well.&nbsp; A few months ago, I added methods to the IO 
  objects</SPAN></FONT></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" color=blue size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: blue">CanStreamRead()/CanStreamWrite().&nbsp; 
  The current IO objects always return false for these methods 
  because</SPAN></FONT></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" color=blue size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: blue">they do not support streaming.&nbsp; When 
  we have an IO object that supports streaming, they will need to 
  respond</SPAN></FONT></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" color=blue size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: blue">true to these methods. I think I put a 
  call to CanStreamRead() in ImageFileReader but I am not sure I put a 
  corresponding call in ImageFileWriter.&nbsp; I look into 
  that.</SPAN></FONT></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" color=blue size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: blue">Jim</SPAN></FONT></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
  <BLOCKQUOTE 
  style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0cm; MARGIN: 5pt 0cm 5pt 3.75pt; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none">
    <P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><FONT face=Tahoma 
    size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original 
    Message-----<BR><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Ron 
    Inbar [mailto:ron@mediguide.co.il]<BR><B><SPAN 
    style="FONT-WEIGHT: bold">Sent:</SPAN></B> Tuesday, April 08, 2003 6:32 
    AM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> 
    'Insight-users@public.kitware.com'<BR><B><SPAN 
    style="FONT-WEIGHT: bold">Subject:</SPAN></B> [Insight-users] Streaming 
    I/O</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">In the course of my 
    efforts to implement an ImageIO subclass that supports streaming, I came 
    across the following code segment (in 
    itkImageFileWriter.txx):</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
    style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
    <P class=MsoNormal><FONT face="Courier New" color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">template</SPAN></FONT><FONT 
    face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> &lt;<FONT 
    color=blue><SPAN style="COLOR: blue">class</SPAN></FONT> 
    TInputImage&gt;</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">void</SPAN></FONT><FONT 
    face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> </SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">ImageFileWriter&lt;TInputImage&gt;</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">::Write(<FONT 
    color=blue><SPAN style="COLOR: blue">void</SPAN></FONT>)</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">{</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp; // . . 
    .</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
    style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp; <FONT 
    color=green><SPAN style="COLOR: green">// Make sure region is within the 
    image, crop if necessary</SPAN></FONT></SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp; ImageIORegion 
    ioRegion(TInputImage::ImageDimension);</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp; 
    ImageRegion&lt;TInputImage::ImageDimension&gt; region = </SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    input-&gt;GetLargestPossibleRegion();</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp; <FONT 
    color=blue><SPAN style="COLOR: blue">const</SPAN></FONT> <FONT 
    color=blue><SPAN style="COLOR: blue">double</SPAN></FONT> *spacing = 
    input-&gt;GetSpacing();</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp; <FONT 
    color=blue><SPAN style="COLOR: blue">const</SPAN></FONT> <FONT 
    color=blue><SPAN style="COLOR: blue">double</SPAN></FONT> *origin = 
    input-&gt;GetOrigin();</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
    style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp; 
    m_ImageIO-&gt;SetNumberOfDimensions(TInputImage::ImageDimension);</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp; <FONT 
    color=blue><SPAN style="COLOR: blue">for</SPAN></FONT>(<FONT 
    color=blue><SPAN style="COLOR: blue">unsigned</SPAN></FONT> <FONT 
    color=blue><SPAN style="COLOR: blue">int</SPAN></FONT> i=0; 
    i&lt;TInputImage::ImageDimension; i++)</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp; 
    {</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp; 
    ioRegion.SetSize(i,region.GetSize(i));</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp; 
    ioRegion.SetIndex(i,region.GetIndex(i));</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp; 
    m_ImageIO-&gt;SetDimensions(i,region.GetSize(i));</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp; 
    m_ImageIO-&gt;SetSpacing(i,spacing[i]);</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp; 
    m_ImageIO-&gt;SetOrigin(i,origin[i]);</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp; 
    }</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp; itkDebugMacro( 
    &lt;&lt;"Region to write = " &lt;&lt; ioRegion );</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp; <FONT 
    color=blue><SPAN 
    style="COLOR: blue">this</SPAN></FONT>-&gt;Write(ioRegion);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    </SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">}</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
    style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">My question is: why does 
    it set the ioRegion to the LargestPossibleRegion and not to the 
    BufferedRegion?</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">(I tried to change it 
    and on first inspection it seems to work OK with the 
    BufferedRegion).</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
    style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
    <P class=MsoNormal><FONT face="Courier New" size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Ron</SPAN></FONT></P>
    <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
    style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P>
    <DIV>
    <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
    style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
    <DIV>
    <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
    style="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</P></DIV>
    <DIV>
    <P class=MsoNormal><STRONG><B><FONT face="Times New Roman" color=navy 
    size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy">This e-mail message has 
    been sent by MediGuide</SPAN></FONT></B></STRONG></P></DIV>
    <DIV>
    <P class=MsoNormal><STRONG><B><FONT face="Times New Roman" color=navy 
    size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy">and is for the use of the 
    intended recipients only.</SPAN></FONT></B></STRONG><B><FONT color=navy 
    size=2><SPAN 
    style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: navy"><BR><STRONG><B><FONT 
    face="Times New Roman">The message may contain&nbsp;privileged or 
    confidential information .</FONT></B></STRONG><BR><STRONG><B><FONT 
    face="Times New Roman">If you are not the intended recipient you are hereby 
    notified that any use,</FONT></B></STRONG><BR><STRONG><B><FONT 
    face="Times New Roman">distribution or copying of this communication is 
    strictly prohibited,</FONT></B></STRONG><BR><STRONG><B><FONT 
    face="Times New Roman">and you are requested to delete the e-mail and any 
    attachments</FONT></B></STRONG></SPAN></FONT></B></P></DIV>
    <DIV>
    <P class=MsoNormal><STRONG><B><FONT face="Times New Roman" color=navy 
    size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy">and notify the sender 
    immediately.</SPAN></FONT></B></STRONG></P></DIV></BLOCKQUOTE></DIV></DIV>
  <DIV><STRONG><FONT color=#000080 size=2></FONT></STRONG>&nbsp;</DIV>
  <DIV><STRONG><FONT color=#000080 size=2></FONT></STRONG>&nbsp;</DIV>
  <DIV><STRONG><FONT color=#000080 size=2>This e-mail message has been sent by 
  MediGuide</FONT></STRONG></DIV>
  <DIV><STRONG><FONT color=#000080 size=2>and is for the use of the intended 
  recipients only.<BR>The message may contain&nbsp;privileged or confidential 
  information .<BR>If you are not the intended recipient you are hereby notified 
  that any use,<BR>distribution or copying of this communication is strictly 
  prohibited,<BR>and you are requested to delete the e-mail and any 
  attachments</FONT></STRONG></DIV>
  <DIV><STRONG><FONT color=#000080 size=2>and notify the sender 
  immediately.</FONT></STRONG></DIV></BLOCKQUOTE></BODY></HTML>

------_=_NextPart_001_01C2FE9E.3193E8A0--