<div dir="ltr">Dear John,<div><br></div><div>In Scipion we have an ImageHandler class that can be used to read/write images/volumes inside stacks or in individual files.</div><div>After reading the image, there is a function getData that return a numpy array that is very flexible in terms of indexing (which can be used for cropping/extracting particles/volumes). </div><div><br></div><div>Recently we were integrating the Localized Reconstruction with Juha Huiskonen and we develop a simple protocol to extract the subparticles from the particles images. The code may serve to illustrate the usage of this classes and its potential. </div><div><br></div><div><a href="https://github.com/I2PC/scipion/blob/devel-localized-recons/pyworkflow/em/packages/opic/protocol_localized_extraction.py#L97">https://github.com/I2PC/scipion/blob/devel-localized-recons/pyworkflow/em/packages/opic/protocol_localized_extraction.py#L97</a><br></div><div><br></div><div>The main downside is that you need to install the whole Scipion framework for just one desired Python function, which I understand that you will prefer to be a self-contained independent function. </div><div><br></div><div>Hope this helps,</div><div>Kind regards,</div><div>Jose Miguel.</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 15, 2016 at 11:24 PM,  <span dir="ltr"><<a href="mailto:john.rubinstein@utoronto.ca" target="_blank">john.rubinstein@utoronto.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Dear Colleagues,<br>
<br>
In order to save some coding, I am hoping that someone can point me to a Python function that is equivalent the MRC Image2010 subroutine Irdpas, which reads part of a section from an MRC format image stack. That is, I would like to specify a z-slice, a start point in x, an end point in x, a start point in y, and an end point in y, and have the function return a 2D array that contains the relevant portion of the specified slice. Any python code that extracts particles from movies should have this function. A more general function that extracts a volume from the stack/volume would also be great.<br>
<br>
Thanks in advance for any suggestions.<br>
<br>
Best regards,<br>
John<br>
<br>
-- <br>
John Rubinstein<br>
Molecular Structure and Function Program<br>
The Hospital for Sick Children Research Institute<br>
686 Bay Street, Rm. 20-9705<br>
Toronto, ON<br>
Canada<br>
M5G 0A4<br>
Tel: (+001) <a href="tel:416-813-7255" value="+14168137255" target="_blank">416-813-7255</a><br>
Fax: (+001) <a href="tel:416-813-5022" value="+14168135022" target="_blank">416-813-5022</a><br>
<a href="http://www.sickkids.ca/research/rubinstein" rel="noreferrer" target="_blank">www.sickkids.ca/research/rubinstein</a><br>
<br>
<br>
<br>
_______________________________________________<br>
3dem mailing list<br>
<a href="mailto:3dem@ncmir.ucsd.edu" target="_blank">3dem@ncmir.ucsd.edu</a><br>
<a href="https://mail.ncmir.ucsd.edu/mailman/listinfo/3dem" rel="noreferrer" target="_blank">https://mail.ncmir.ucsd.edu/mailman/listinfo/3dem</a><br>
</blockquote></div><br></div></div>