hadim / read-roi

Read ROI files .zip or .roi generated with ImageJ.
BSD 3-Clause "New" or "Revised" License
51 stars 22 forks source link

How can I save the rois into a zip file, which imageJ can open. #23

Closed FengZhiheng closed 4 years ago

FengZhiheng commented 4 years ago

Hi Hadrien. How can I save the rois into a zip file, which imageJ can open. Thanks very much

scottclowe commented 4 years ago

Hi, Feng Zhiheng. Saving ROIs to a zip file for ImageJ to open is outside the scope of read-roi, which is just for reading ROIs which were exported from ImageJ into Python.

You could use PymageJ, but it can only write rectangular ROIs (and I think only on Python2). Or use the imagej package on pypi to interact with the ImageJ program from Python and tell it to save a ROI for you.

I don't know of an existing, fully-fledged Python implementation for writing to ImageJ ROIs. There is not much demand for one. If you want to develop one yourself, you could do so by referring to RoiEncoder.java along with the source for PymageJ and read-roi which will illustrate how RoiDecoder.java was mapped to a Python3 implementation.

FengZhiheng commented 4 years ago

I got it. It's very kind of you for your reply.

---Original--- From: "Scott Lowe"<notifications@github.com> Date: Fri, Jul 3, 2020 17:16 PM To: "hadim/read-roi"<read-roi@noreply.github.com>; Cc: "Feng Zhiheng"<592440477@qq.com>;"Author"<author@noreply.github.com>; Subject: Re: [hadim/read-roi] How can I save the rois into a zip file, which imageJ can open. (#23)

Hi, Feng Zhiheng. Saving ROIs to a zip file for ImageJ to open is outside the scope of read-roi, which is just for reading ROIs which were exported from ImageJ into Python.

You could use PymageJ, but it can only write rectangular ROIs. Or use the imagej package on pypi to interact with the ImageJ program from Python and tell it to save a ROI for you.

I don't know of an existing, fully-fledged Python implementation for writing to ImageJ ROIs. There is not much demand for one. If you want to develop one yourself, you could do so by referring to RoiEncoder.java along with the source for PymageJ and read-roi which will illustrate how RoiDecoder.java was mapped to a Python3 implementation.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

scottclowe commented 4 years ago

No problem.

If you do find a Python implementation of an ImageJ-ROI exporter, or another solution that works for you (i.e. interfacing with ImageJ through the imagej package), please let us know so we can direct any one else who is looking for the same thing to your response.