Open wafels opened 12 years ago
Example use case:
1) User uses HEK module to get a list of events for some time range. 2) BBox info/chain-code from HEK results are automatically converted to SunPy RegionOfInterest instances. 3) Those instances can then be drawn as overlays on a Map instance, using something like "aiamap.show(overlays=hek_events)"
So, a ROI object as I understand it would contain at least the following:
We discussed yesterday that the ROI could contain a number of functions (methods), such as 'GROW' or 'SHRINK' or 'ROTATE' - Not sure how useful those would be for a free-form ROI though. Anyone have thoughts on other useful primary functions?
Hehe. now that you have a Git account....
Here are some possible ways I could imagine creating a new RegionOfInterest:
roi = RegionOfInterest(0, 0, 100, 100) # x1, y1, x2, y2
roi = RegionOfInterest(0, 0, 0, 100, 100, 100) # x1, y1, z1, x2, y2, z2
roi = RegionOfInterest([(79.500,-552.300),(80.100,-551.700),(94.500,-531.900), ...]) # chaincode (2d)
roi = RegionOfInterest([(79.500,-552.300, 100.),(80.100,-551.700, 200.),(94.500,-531.900, 300.), ...]) # chaincode (3d)
Question: What about circles/spheres?
If only three values are specified, we could assume it is x0, y0, r, but if four values are specified it could either be a sphere, or a 2d rectangle. Perhaps we should use kwargs to make it more clear? E.g.:
roi = RegionOfInterest(rect=[...])
roi = RegionOfInterest(circle=[...])
roi = RegionOfInterest(sphere=[...])
roi = RegionOfInterest(polygon=[...])
What do you guys think?
Should the ROI require a specified datetime ?
roi = RegionOfInterest(rect=[...], datetime = ...) roi = RegionOfInterest(circle=[...], datetime = ...) roi = RegionOfInterest(sphere=[...], datetime = ...) roi = RegionOfInterest(polygon=[...], datetime = ...) roi = RegionOfInterest(chaincode=[...], datetime = ...)
is better. Note you have to specify co-ordinate systems and units as well.
Also,
rois = [roi1, roi2, roi3,..., ]
aia.show(overlay = rois, useOverlayDateTime = True )
useOverlayDateTime = True : only display ROIs that overlap with the map object datetime useOverlayDateTime = False : ignore the ROIs map object datetimes and plot them all on the map
On Wed, Jun 27, 2012 at 11:45 AM, Keith Hughitt < reply@reply.github.com
wrote:
Here are some possible ways I could imagine creating a new RegionOfInterest:
roi = RegionOfInterest(0, 0, 100, 100) # x1, y1, x2, y2 roi = RegionOfInterest(0, 0, 0, 100, 100, 100) # x1, y1, z1, x2, y2, z2 roi = RegionOfInterest([(79.500,-552.300),(80.100,-551.700),(94.500,-531.900), ...]) # chaincode (2d) roi = RegionOfInterest([(79.500,-552.300, 100.),(80.100,-551.700, 200.),(94.500,-531.900, 300.), ...]) # chaincode (3d)
Question: What about circles/spheres?
If only three values are specified, we could assume it is x0, y0, r, but if four values are specified it could either be a sphere, or a 2d rectangle. Perhaps we should use kwargs to make it more clear? E.g.:
roi = RegionOfInterest(rect=[...]) roi = RegionOfInterest(circle=[...]) roi = RegionOfInterest(sphere=[...]) roi = RegionOfInterest(polygon=[...])
What do you guys think?
Reply to this email directly or view it on GitHub: https://github.com/sunpy/sunpy/issues/164#issuecomment-6607035
Default for datetime could be datetime.datetime.utcnow(). What is the difference between polygon and chaincode?
I suppose none in effect, but they might have different definitions.
don't forget the grow and shrink methods. an attribute should probably be "shape" such as "rectangle" "circle" "polygon".
There are many different ways to perform a "grow" and a "shrink" operation; scipy has a set of these operators under the "morphology" module
http://docs.scipy.org/doc/scipy/reference/ndimage.html#module-scipy.ndimage.morphology .
They are very handy.
I suppose you could pick one method and say "This is the default method", but you are not guaranteed to end up with something like you thought you were going to get. For example, the "shrink" operation may end up splitting one ROI in to two unconnected ROIs. How will we handle that? Is this what the user wants? On saying that, there are probably ways to ensure that you only ever return a single region after a "shrink" operation, but such considerations veer quickly in to the domain of image manipulation and away from a simple ROI object. I'm not saying it shouldn't be done, I'm just saying it requires some experimentation first.
$0.02
jack
On Wed, Jun 27, 2012 at 11:22 PM, Steven Christe < reply@reply.github.com
wrote:
don't forget the grow and shrink methods. an attribute should probably be "shape" such as "rectangle" "circle" "polygon".
Reply to this email directly or view it on GitHub: https://github.com/sunpy/sunpy/issues/164#issuecomment-6621067
Hey @dpshelio are you likely to get this wrapped up for 0.3?
I have gone through modules for HEK and HELIO and also checked the ROI and CHAINCODE module as you previously suggested. But I am confused about which area of implementation I should begin with, like making the different area regions like the square, circle, rectangle and then ensuring panning is still available or any specific thing.
Has there been any planning on this feature?
There has been little planning concerning this feature. It depends what you mean by "region". Region originally meant a closed area in 2 spatial dimensions. Maybe we could start with that concept and generalize as necessary. A generalization would be a closed volume in any physical space describable by WCS co-ordinates?
On Fri, Mar 16, 2018 at 6:12 AM, Nabil Freij notifications@github.com wrote:
Has there been any planning on this feature?
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/sunpy/sunpy/issues/164#issuecomment-373666568, or mute the thread https://github.com/notifications/unsubscribe-auth/AA8CF0trsatN21m57DMsv4oxllhb4_Zcks5te4_1gaJpZM4AC9fF .
What I mean from region is, we already have chaincode module so are we supposed to somehow modify it to give outputs for rectangle, square and circle etc or similar module are supposed to be made as what I figured out was that chaincode returns a plot with the nodes marked as specified and does not relate to ROI for now. So should similar modules for all special figures should be made and than use them to mark a ROI as our need.
This seems to exist here: https://docs.sunpy.org/en/stable/api/sunpy.roi.roi.html#sunpy.roi.roi . If there are requests to extend the functionality of the existing class then should we split those out to new issues?
The current one is being deprecated in 3.0 and will be removed after.
Astropy have one now: https://astropy-regions.readthedocs.io/en/stable/index.html
We should investigate if this will work for us
It would be good to have a region of interest (ROI) object.
A ROI object would contain at least the following:
Example use case:
User uses HEK module to get a list of events for some time range. BBox info/chain-code from HEK results are automatically converted to SunPy RegionOfInterest instances. Those instances can then be drawn as overlays on a Map instance, using something like "aiamap.show(overlays=hek_events)"
Here are some possible ways I could imagine creating a new RegionOfInterest:
See an older GSoC project: https://openastronomy.org/gsoc/gsoc2018/#/projects?project=region_of_interest
Extra
More generally it would be good to have an HEK event class that holds event information. That could be an ROI or EOI factory, that understand HEK or other type of outputs.
WIP about extra methods
Could contain a number of functions (methods), such as 'GROW' or 'SHRINK' or 'ROTATE'. There are many different ways to perform a "grow" and a "shrink" operation; scipy has a set of these operators under the "morphology" module
http://docs.scipy.org/doc/scipy/reference/ndimage.html#module-scipy.ndimage.morphology
I suppose you could pick one method and say "This is the default method", but you are not guaranteed to end up with something like you thought you were going to get. For example, the "shrink" operation may end up splitting one ROI in to two unconnected ROIs.
How will we handle that? Is this what the user wants? On saying that, there are probably ways to ensure that you only ever return a single region after a "shrink" operation, but such considerations veer quickly in to the domain of image manipulation and away from a simple ROI object. I'm not saying it shouldn't be done, I'm just saying it requires some experimentation first.