<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Bradley, I think this is what I want to do.&nbsp;<div>Thanks a lot and sorry again for the mailing list.</div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-style: normal; font-weight: normal; font-size: medium; font-family: Helvetica; color: rgb(0, 0, 0); "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; "><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">Saludos</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">__________________________________<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Ariel Hernán Curiale Ph.D Student<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;ETSI Telecomunicación<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Universidad de Valladolid<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Campus Miguel Delibes<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;47011 Valladolid, Spain<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Phone: 983-423000 ext. 5590</div><div><font class="Apple-style-span" color="#b7b7b7" style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">|</font>&nbsp;Web:&nbsp;<a href="http://www.curiale.com.ar/"><font class="Apple-style-span" color="#084ebe">www.curiale.com.ar</font></a><br><font class="Apple-style-span" color="#b7b7b7" style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">|</font><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; color: rgb(0, 0, 0); ">_________________________________</span></div></div></div></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div></span></span>
</div>
<br><div><div>El 17/01/2013, a las 15:04, Bradley Lowekamp escribió:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Ariel,<div><br></div><div>Please respond to all to include the mailing list so that all may benefit.</div><div><br></div><div>I agree you certainly should be able to set and get a vector pixel type, I'll try to make that happen in the next week or so.&nbsp;</div><div><br></div><div>However, I must warn you that this is not a very fast approach for any interpretive language. You really should avoid iterating in Python on all the pixels unless the image is of trivial size.&nbsp;Using a tuple to perform computation is an additional burden too. Generally it mean looping those nested elements too.</div><div><br></div><div>There is a very large selection of image operators, and function available. There is a good chance you can do the majority of you computation on the whole image at once. Which will be significantly more efficient. Take for example the function below to generate a Marschner-Lobb function.</div><div><br></div><div><div>def marschner_lobb(size=40, alpha=0.25, f_M=6.0):</div><div>&nbsp; &nbsp; img = sitk.PhysicalPointSource( sitk.sitkVectorFloat32, [size]*3, [-1]*3, [2.0/size]*3)</div><div>&nbsp; &nbsp; imgx = sitk.VectorIndexSelectionCast(img, 0)</div><div>&nbsp; &nbsp; imgy = sitk.VectorIndexSelectionCast(img, 1)</div><div>&nbsp; &nbsp; imgz = sitk.VectorIndexSelectionCast(img, 2)</div><div>&nbsp; &nbsp; del img</div><div>&nbsp; &nbsp; r = sitk.Sqrt(imgx**2 + imgy**2)</div><div>&nbsp; &nbsp; del imgx, imgy</div><div>&nbsp; &nbsp; pr = sitk.Cos((2.0*math.pi*f_M)*sitk.Cos((math.pi/2.0)*r))</div><div>&nbsp; &nbsp; return (1.0 - sitk.Sin((math.pi/2.0)*imgz) + alpha*(1.0+pr))/(2.0*(1.0+alpha))</div></div><div><br></div><div><br></div><div>If there is some specific computation that you are trying todo, please describe it so I perhaps can recommend a sequence of filters and operator to accomplish it.</div><div><br></div><div>Brad</div><div><br></div><div><br></div><div><br><div><div>On Jan 17, 2013, at 3:34 AM, Ariel Hernán Curiale &lt;<a href="mailto:curiale@gmail.com">curiale@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Bradley,<div><br></div><div>Thanks for your reply. I'm using&nbsp;SimpleITK version 0.5.1. I just want to have a way to read the pixel value to perform some computation and create another image with this value (another VectorImage) I prefer to obtain a python tuple or a list like the Image.GetSize().</div><div><br></div><div>&nbsp;Pd: I'll try later the 0.6rc1 version.<br><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">Thanks</div><div style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">__________________________________<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Ariel Hernán Curiale Ph.D Student<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;ETSI Telecomunicación<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Universidad de Valladolid<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Campus Miguel Delibes<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;47011 Valladolid, Spain<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Phone: 983-423000 ext. 5590</div><font class="Apple-style-span" color="#b7b7b7" style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">|</font>&nbsp;Web:&nbsp;<a href="http://www.curiale.com.ar/"><font class="Apple-style-span" color="#084ebe">www.curiale.com.ar</font></a><br><font class="Apple-style-span" color="#b7b7b7" style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">|</font>_________________________________</span>
</div>
<br><div><div>El 16/01/2013, a las 20:25, Bradley Lowekamp escribió:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,<div><br></div><div>What version of SimpleITK are you using?</div><div><br></div><div>With 0.6rc1 there have been major improvements to support multi-dimensional slice based indexing. Which incorporates start:stop:stride, for the physical dimensions not the vector components. It appears that there may been some regression in behavior with the GetPixel method... What are you currently able to get a scalar component value? And you say you expect a "vector value" do you want a wrapped std::vector, a python tuple, or what?</div><div><br></div><div>As a couple people have asked me about the slice based indexing and vector images. I am thinking that maybe the should be done before the 0.6 release is done.</div><div><br></div><div>Please let me know what you need and expect the behavior to be.</div><div><br></div><div>Thanks,</div><div>Brad</div><div><br></div><div><br></div><div><br><div><div>On Jan 16, 2013, at 12:56 PM, Ariel Hernán Curiale &lt;<a href="mailto:curiale@gmail.com">curiale@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi all,<div><br></div><div>This is my first time with SimpleITK and looks really great.&nbsp;I'm trying to use it for a quick developments (SimpleITK + Python) but I don't know how I can get the pixel value of a VectorImage. Could Anyone give some tips about it ?</div><div>Is there a way to get the vector instead a single value or I need to use a filter to get the vector value ?&nbsp;</div><div>&nbsp;<br><div>
<span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">Thanks a lot,</div><div style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">__________________________________<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Ariel Hernán Curiale Ph.D Student<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;ETSI Telecomunicación<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Universidad de Valladolid<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Campus Miguel Delibes<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;47011 Valladolid, Spain<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Phone: 983-423000 ext. 5590</div><font class="Apple-style-span" color="#b7b7b7" style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">|</font>&nbsp;Web:&nbsp;<a href="http://www.curiale.com.ar/"><font class="Apple-style-span" color="#084ebe">www.curiale.com.ar</font></a><br><font class="Apple-style-span" color="#b7b7b7" style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">|</font>_________________________________</span>
</div>
<br></div></div>_____________________________________<br>Powered by <a href="http://www.kitware.com/">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html">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">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">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">http://www.itk.org/mailman/listinfo/insight-users</a><br></blockquote></div><br></div></div></blockquote></div><br></div></div></blockquote></div><br></div></div></blockquote></div><br></body></html>