<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; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>
<div>This is probably the example that you are looking for.</div>
<div><br>
</div>
<div><a href="http://www.itk.org/SimpleITKDoxygen/html/BufferImportExport_8cxx-example.html">http://www.itk.org/SimpleITKDoxygen/html/BufferImportExport_8cxx-example.html</a></div>
<div><br>
</div>
<div>Vince</div>
<div><br>
</div>
<div>
<div id="MAC_OUTLOOK_SIGNATURE">
<div>-- </div>
<div>
<div>Associate Professor</div>
<div>Department of Radiology</div>
<div>L311 PBDB</div>
<div>169 Newton Road</div>
<div>Iowa City, IA 52242</div>
<div>E-mail: vincent-magnotta@uiowa.edu</div>
<div>Phone: 319-335-5482 Fax: 319-353-6275</div>
<div>Website: http://www.healthcare.uiowa.edu/Radiology</div>
</div>
</div>
</div>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:12pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Insight-users <<a href="mailto:insight-users-bounces@itk.org">insight-users-bounces@itk.org</a>> on behalf of Piotr Piasecki <<a href="mailto:piotpia124@student.polsl.pl">piotpia124@student.polsl.pl</a>><br>
<span style="font-weight:bold">Date: </span>Sunday, April 17, 2016 at 11:18 AM<br>
<span style="font-weight:bold">To: </span>Bradley Lowekamp <<a href="mailto:brad@lowekamp.net">brad@lowekamp.net</a>><br>
<span style="font-weight:bold">Cc: </span>"<a href="mailto:insight-users@itk.org">insight-users@itk.org</a>" <<a href="mailto:insight-users@itk.org">insight-users@itk.org</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [ITK-users] itk::simple::Image from stream<br>
</div>
<div><br>
</div>
<span style="mso-bookmark:_MailOriginalBody">
<div>
<div>
<div dir="ltr">
<div>Thank you for your answer. Unfortunately, it seems to me that's not what I meant. This example shows how to get buffer from itk.simple.Image and have access to pixel values. To create an object SimpleITK.ReadImage method is used.<br>
<br>
In my problem, I receive DICOM file from REST Api and I got it as a System.IO.Stream in my code. I need to create itk.simple.Image from that stream, because I do not want to save the file on local disk, and then load it again using ImageFileReader or SimpleITK.ReadImage.<br>
<br>
</div>
Regards.<br>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2016-04-17 16:29 GMT+02:00 Bradley Lowekamp <span dir="ltr">
<<a href="mailto:brad@lowekamp.net" target="_blank">brad@lowekamp.net</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I think this example is what you are looking for:<br>
<br>
<a href="http://www.itk.org/SimpleITKDoxygen/html/ImageGetBuffer_8cs-example.html" rel="noreferrer" target="_blank">http://www.itk.org/SimpleITKDoxygen/html/ImageGetBuffer_8cs-example.html</a><br>
<div class="HOEnZb">
<div class="h5"><br>
> On Apr 17, 2016, at 9:11 AM, Piotr Piasecki <<a href="mailto:piotpia124@student.polsl.pl">piotpia124@student.polsl.pl</a>> wrote:<br>
><br>
> Dear Sir or Madam.<br>
><br>
> I am a student in Biomedical Engineering at the Silesian University of Technology. During my studies I worked with ITK and SimpleITK in C#. I wanted to use them in my current project, but I have an important question. Is there a possibility to create object
 of itk::simple::Image class from stream or byte array, not by using ImageFileReader? If there is no such possibility in SimpleITK in C#, is it possible in native ITK?<br>
><br>
> I will be very grateful for any answer.<br>
><br>
> Best regards.<br>
><br>
> Peter.<br>
> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" 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" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">
http://public.kitware.com/mailman/listinfo/insight-users</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</span></span><br>
<br>
<hr>
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any
 retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
<hr>
</body>
</html>