<div dir="ltr"><div>Hi Kai,</div><div><br></div><div>> Is there maybe a neat way of how I could achieve my goal?</div><div><br></div><div>Alison Walter and I will also be at the meeting presenting the latest work on ImageJ-OMERO [1]. Let's definitely try using it for your stated goals, since I think it would be a good fit.</div><div><br></div><div>With ImageJ-OMERO when you open a large image from OMERO, it reads pixels only on demand, so you should be able to avoid up-front import of lots of pixels, and then only process the first time point as desired. The newest version of ImageJ-OMERO (release forthcoming) now supports ROIs and tables as well, so all the attached ROIs will come down as well. Then you can work with them in the ROI Manager.</div><div><br></div><div>Regards,</div><div>Curtis</div><div><br></div><div>[1] <a href="https://github.com/imagej/imagej-omero">https://github.com/imagej/imagej-omero</a><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><span style="font-size:12.8px">--</span></div><div><span style="font-size:12.8px">Curtis Rueden</span><br></div><div><span style="font-size:12.8px">LOCI software architect - <a href="https://loci.wisc.edu/software" target="_blank">https://loci.wisc.edu/software</a></span></div><div>ImageJ2 lead, Fiji maintainer - <span style="font-size:12.8px"><a href="https://imagej.net/User:Rueden" target="_blank">https://imagej.net/User:Rueden</a></span></div><div>Did you know ImageJ has a forum? <a href="http://forum.imagej.net/" target="_blank">http://forum.imagej.net/</a></div><div><br></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Fri, May 25, 2018 at 11:02 AM, Kai Schleicher <span dir="ltr"><<a href="mailto:kai.schleicher@unibas.ch" target="_blank">kai.schleicher@unibas.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>Hi Jean-Marie,</p>
    <p>thanks again for your reply! I realise that my request was not
      very clear:<br>
    </p>
    <p>I have time laps images (hyperstacks of 2C,75Z, 150T) in OMERO
      which all have ROIs stored in only the first time point. The ROIs
      where added using OMERO.<br>
    </p>
    <p>I am trying to write a script that <br>
    </p>
    <p>(i) fetches the first time point from all hyperstacks of a given
      dataset including their ROIs (ie, per hyperstack 2C,75Z, 1T)<br>
    </p>
    <p>(iii) runs an ImageJ macro on each hyperstack. This macro will
      require the ROIs to be present in the ImageJ ROI manager<br>
    </p>
    <p>My current script is based on the old one from Balaji [1] and
      already achieves this in principle, but I can not limit the import
      to only the first time point.</p>
    <p>With the newer version [2] you referred me to this can be fixed,
      but here I failed to import the ROIs from OMERO into the ImageJ
      ROI manager.</p>
    <p>Is there maybe a neat way of how I could achieve my goal?<br>
      Perhaps these two scripts could be combine (maybe including [3]?),
      but so far I failed to do so.</p>
    <p>Thank you again for your help and see you soon at the meeting,<br>
      Kai</p>
    <p>[1]
<a class="m_-8145985949449936710moz-txt-link-freetext" href="https://github.com/bramalingam/Omero-Imagej-Scripts/blob/master/omero_batch_analysis.py" target="_blank">https://github.com/<wbr>bramalingam/Omero-Imagej-<wbr>Scripts/blob/master/omero_<wbr>batch_analysis.py</a><br>
      [2] <span id="m_-8145985949449936710OLK_SRC_BODY_SECTION"><a href="https://github.com/ome/training-scripts/blob/master/practical/jython/analyse_particles_from_dataset.jy" target="_blank">https://github.com/ome/<wbr>training-scripts/blob/master/<wbr>practical/jython/analyse_<wbr>particles_from_dataset.jy<br>
          [3] </a></span><a href="https://github.com/ome/training-scripts/blob/master/practical/jython/analyse_particles_from_dataset.jy" target="_blank"><span id="m_-8145985949449936710OLK_SRC_BODY_SECTION"> </span></a><a class="m_-8145985949449936710moz-txt-link-freetext" href="https://github.com/ome/training-scripts/blob/master/practical/jython/omero_rois_to_imagej_roi.jy" target="_blank">https://github.com/ome/<wbr>training-scripts/blob/master/<wbr>practical/jython/omero_rois_<wbr>to_imagej_roi.jy</a><br>
      <span id="m_-8145985949449936710OLK_SRC_BODY_SECTION"></span></p><div><div class="h5">
    <br>
    <div class="m_-8145985949449936710moz-cite-prefix">On 05/21/2018 02:17 PM, Jean-Marie
      Burel (Staff) wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div>Hi Kai</div>
      <div><br>
      </div>
      <div>To read the ROI when opening an image from OMERO to ImageJ</div>
      <div>We use the Bio-Formats Importer option</div>
      <div>The ROIs are read using <a href="https://github.com/openmicroscopy/bioformats/blob/develop/components/bio-formats-plugins/src/loci/plugins/util/ROIHandler.java" target="_blank">https://github.com/<wbr>openmicroscopy/bioformats/<wbr>blob/develop/components/bio-<wbr>formats-plugins/src/loci/<wbr>plugins/util/ROIHandler.java</a></div>
      <div><br>
      </div>
      <div>This can be a bit confusing</div>
      <div>Will you need a Jython script that convert imagej ROIs to
        OMERO?</div>
      <div><br>
      </div>
      <div>Cheers</div>
      <div><br>
      </div>
      <div>Jmarie</div>
      <div><br>
      </div>
      <span id="m_-8145985949449936710OLK_SRC_BODY_SECTION">
        <div style="font-family:Calibri;font-size:11pt;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>Kai Schleicher
          <<a href="mailto:kai.schleicher@unibas.ch" target="_blank">kai.schleicher@unibas.ch</a>><br>
          <span style="font-weight:bold">Date: </span>Friday, 18 May
          2018 at 16:33<br>
          <span style="font-weight:bold">To: </span>OME User Support
          List <<a href="mailto:ome-users@lists.openmicroscopy.org.uk" target="_blank">ome-users@lists.<wbr>openmicroscopy.org.uk</a>>,
          jmarie burel <<a href="mailto:j.burel@dundee.ac.uk" target="_blank">j.burel@dundee.ac.uk</a>><br>
          <span style="font-weight:bold">Subject: </span>Re:
          [ome-users] syntax for scripting the windowless importer in
          Jython<br>
        </div>
        <div><br>
        </div>
        <div>
          <div text="#000000" bgcolor="#FFFFFF">
            <p>Hi Jean-Marie,</p>
            <p>thanks for your reply and the updated scripts! I switched
              to the newer version you mentioned and it works like a
              charm, it was easy to adept to fetch only the time points
              that I like to have!</p>
            <p>I would like to further extend it and get the ROIs
              associated to that image from OMERO into the ROI manger of
              ImageJ.</p>
            <p>I found how this could be done in the example scripts,
              i.e <a class="m_-8145985949449936710moz-txt-link-freetext" href="https://github.com/ome/training-scripts/blob/master/practical/jython/omero_rois_to_imagej_roi.jy" target="_blank">
https://github.com/ome/<wbr>training-scripts/blob/master/<wbr>practical/jython/omero_rois_<wbr>to_imagej_roi.jy</a><br>
            </p>
            Just as a question, is this script already available as a
            class in OMER.insight?<br>
            Like a "ROIwriter class", as opposed to the ROIreader class
            from <a href="http://org.openmicroscopy.shoola.util.roi.io" target="_blank">org.openmicroscopy.shoola.<wbr>util.roi.io</a><br>
            <br>
            Since this is a feature that is already in OMERO.insight, I
            figure there must be such a class, I just don't know its
            name :)<br>
            <br>
            I apologize in advance, as these type of questions must be
            tedious to answer one by one (you are not a
            class/command/package lookup service), but I just started
            trying to find my way through the documentation.<br>
            <br>
            Thanks and cheers,<br>
            Kai<br>
            <br>
            <div class="m_-8145985949449936710moz-cite-prefix">On 05/17/2018 10:11 PM,
              Jean-Marie Burel (Staff) wrote:<br>
            </div>
            <blockquote type="cite">
              <div>Hi Kai</div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div>All the scripts are now available at <a href="https://github.com/ome/training-scripts" target="_blank">https://github.com/ome/<wbr>training-scripts</a></div>
              <div><br>
              </div>
              <div>I did a bit of digging and it seems that the option
                specifyRanges=true is taken into account only when
                windowless=false</div>
              <div>In that case the values in the range dialog are read.</div>
              <div><br>
              </div>
              <div>We have written a new version of the script you
                mentioned</div>
              <div>The new version  does not use the BF-importer plugin</div>
              <div><a href="https://github.com/ome/training-scripts/blob/master/practical/jython/analyse_particles_from_dataset.jy" target="_blank">https://github.com/ome/<wbr>training-scripts/blob/master/<wbr>practical/jython/analyse_<wbr>particles_from_dataset.jy</a></div>
              <div>This should hopefully allow you to only retrieve the
                planes you want</div>
              <div><br>
              </div>
              <div>Cheers</div>
              <div>Jmarie</div>
              <div><br>
              </div>
              <span id="m_-8145985949449936710OLK_SRC_BODY_SECTION">
                <div style="font-family:Calibri;font-size:11pt;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>ome-users
                  <<a href="mailto:ome-users-bounces@lists.openmicroscopy.org.uk" target="_blank">ome-users-bounces@lists.<wbr>openmicroscopy.org.uk</a>>
                  on behalf of Kai Schleicher <<a href="mailto:kai.schleicher@unibas.ch" target="_blank">kai.schleicher@unibas.ch</a>><br>
                  <span style="font-weight:bold">Reply-To: </span>OME
                  User Support List <<a href="mailto:ome-users@lists.openmicroscopy.org.uk" target="_blank">ome-users@lists.<wbr>openmicroscopy.org.uk</a>><br>
                  <span style="font-weight:bold">Date: </span>Thursday,
                  17 May 2018 at 18:11<br>
                  <span style="font-weight:bold">To: </span>"<a href="mailto:ome-users@lists.openmicroscopy.org.uk" target="_blank">ome-users@lists.<wbr>openmicroscopy.org.uk</a>"
                  <<a href="mailto:ome-users@lists.openmicroscopy.org.uk" target="_blank">ome-users@lists.<wbr>openmicroscopy.org.uk</a>><br>
                  <span style="font-weight:bold">Subject: </span>[ome-users]
                  syntax for scripting the windowless importer in Jython<br>
                </div>
                <div><br>
                </div>
                <div>
                  <div text="#000000" bgcolor="#FFFFFF">
                    <p>Dear OME-team,</p>
                    <p>To script the windowless BF-importer in Jython I
                      am building on the cool <a href="https://github.com/bramalingam/Omero-Imagej-Scripts/blob/master/omero_batch_analysis.py" target="_blank">
                        script by Balaji</a>.</p>
                    <p>I specifically wish to limit the import to the
                      first time-point of my datasets, but I am
                      struggling at getting the syntax right.</p>
                    <p>In IJ1-macro language it works like this:<br>
                    </p>
                    <blockquote type="cite">run("Bio-Formats Importer",
                      "open=V:/small5Dstack.tif specify_range t_begin=1
                      t_end=1 t_step=1");</blockquote>
                    In the jython script I tried to add a line 53:<br>
                    <blockquote type="cite">options += "
                      specifyranges=true tbegin=1 tend=1 tstep=1 "</blockquote>
                    But it still loads the entire dataset.<br>
                    I tried a few other strings without luck and was
                    wondering if you could maybe just point me to the
                    proper way of doing it.
                    <p>Thanks and see you soon at the meeting,<br>
                      Kai</p>
                    <pre class="m_-8145985949449936710moz-signature" cols="72">-- 
>>Please note my NEW PHONE NUMBERS: +41 61 207 57 31 (direct) +41 61 207 22 50 (central)<<
Kai Schleicher, PhD | Research Associate in Advanced Light Microscopy | Biozentrum, University of Basel | Klingelbergstrasse 50/70 | CH-4056 Basel |
Phone: +41 61 207 57 31 (direct) +41 61 207 22 50 (central) | <a class="m_-8145985949449936710moz-txt-link-abbreviated" href="mailto:kai.schleicher@unibas.ch" target="_blank">kai.schleicher@unibas.ch</a> | <a class="m_-8145985949449936710moz-txt-link-abbreviated" href="http://www.biozentrum.unibas.ch" target="_blank">www.biozentrum.unibas.ch</a> | <a class="m_-8145985949449936710moz-txt-link-abbreviated" href="http://www.microscopynetwork.unibas.ch" target="_blank">www.microscopynetwork.unibas.<wbr>ch</a></pre>
                  </div>
                </div>
              </span><br>
              <span style="font-size:10pt">The University of Dundee is
                a registered Scottish Charity, No: SC015096</span><br>
              <fieldset class="m_-8145985949449936710mimeAttachmentHeader"></fieldset>
              <br>
              <pre>______________________________<wbr>_________________
ome-users mailing list
<a class="m_-8145985949449936710moz-txt-link-abbreviated" href="mailto:ome-users@lists.openmicroscopy.org.uk" target="_blank">ome-users@lists.<wbr>openmicroscopy.org.uk</a><a class="m_-8145985949449936710moz-txt-link-freetext" href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users" target="_blank">http://<wbr>lists.openmicroscopy.org.uk/<wbr>mailman/listinfo/ome-users</a></pre>
            </blockquote>
            <br>
          </div>
        </div>
      </span><br>
      <span style="font-size:10pt">The University of Dundee is a
        registered Scottish Charity, No: SC015096</span>
    </blockquote>
    <br>
  </div></div></div>

<br>______________________________<wbr>_________________<br>
ome-users mailing list<br>
<a href="mailto:ome-users@lists.openmicroscopy.org.uk">ome-users@lists.<wbr>openmicroscopy.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users" rel="noreferrer" target="_blank">http://lists.openmicroscopy.<wbr>org.uk/mailman/listinfo/ome-<wbr>users</a><br>
<br></blockquote></div><br></div>