Skip to content

DM-7147: fix region bugs as listed in DM-7147. #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 11, 2016
Merged

Conversation

cwang2016
Copy link
Contributor

fix the following region bugs,

  1. set the default coordinate system to be 'PHYSICAL' (fixed in DM-5192-PyAPI)
  2. region defined with 'PHYSICAL' or 'IMAGE' is treated as 'IMAGE' coordinate
    3 . create region layer after the image with plotId finishes loading - changing the region description parsing which needs plotId info to be done after after the region layer is created (fixed in DM-7088)
  3. select the region from any region layer
  4. log region parsing error in the console.

test:
start firefly demo file,
localhost:8080/firefly/demo/ffapi-highlevel-test.html

  • click on 'test open' to get the Firefly app
  • go to the page bottom for 'region test'
  • test for bug 1, click on 'Create Region Layer' (for layer Region_Plot_1), the top two regions with no coordinate system specified shown in the text box is displayed as with default coordinate system.
  • test for bug 2, as the display of 'Region_Plot_1', the first two boxes and the last two boxes are all treated as 'IMAGE' coordinates though some of the boxes are defined on 'PHYSICAL'.
  • test for bug 4, continue to click on 'Create Region Layer' (for layer Region_Plot_2), click any region from either layer 'Region_Plot_1' and 'Region_Plot_2 as shown on the Firefly app.
  • test for bug 5, continue to click on 'Create Region Layer' (for layer Region_Plot_3), the first box is defined with wrong syntax as the error logged in the console.

DM-7147: fix region bugs as listed in DM-7147.
'global color=green dashlist=8 3 width=1 font="helvetica 10 normal normal" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 rotate=0 source=1',
'J2000;point 202.41 47.262 # color=pink text="pt circle 1" point=circle',
'box (100p, 70p, 20p, 20p, 0) #color=red text={IMAGE coordinate - 1}',
'box (100i, 70i, 30i, 30i, 0) #color=orange text={PHYSICAL coordinate -2}',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMAGE and PHYSICAL in the text should be switched for these two items: p is used for physical pixels, i - for image pixels

@tgoldina
Copy link
Contributor

1,2,5 are working as expected.

4 mostly works, but when I plot the same regions on two images – firefly/html/demo/ffapi-2images.html – any region selection on the second image adds an error to the console:
ShapeDataObj.js:428 Uncaught TypeError: Cannot read property 'x' of null

3 does not work. To test, add the following dispatch after the second showImage call in in firefly/html/demo/ffapi-2images.html:

firefly.action.dispatchCreateRegionLayer('region3', 'Region Layer 3', null, ['image; box 200 200 72 72 0 # color=red'], ['image1', 'image2']);

The error is 'Cannot read property 'getImageCoords' of null in RegionFactory:618'

@cwang2016
Copy link
Contributor Author

The fixings are regarding the solution for the issue 3 &5:

  • for issue 3: remove the plot denpendency from region parsing (RegionFactory.js). This change is due to the realization that 'PHYSICAL' coordinate is some transformation from 'IMAGE' coordinate, not related to screen pixel.
  • for issue 5: enable the region selection on multiple image plots, showing the highlight box (dotted line box) around the selected region on various plots by dynamically updating the geometrical data of the highlight box for each plot before the drawing.

@cwang2016
Copy link
Contributor Author

test for issue 5 on various types of regions:

  • start firefly app, localhost:8088/firefly
  • get two images:
    images -> target, m51 -> WISE, level: 4 band atlas, band: 1
    images -> target, m51 -> WISE, level: 4 band level 1, band: 1
  • upload region file from src/firefly/test/edu/caltech/ipac/visualize/test5.reg
  • regions are drawn on two images, select the region from one plot, the relevant region on the other plot is also highlighted.

@cwang2016
Copy link
Contributor Author

please rebuild firefly by using 'gradle'.

@tgoldina
Copy link
Contributor

Everything works as expected. Review complete.

@cwang2016 cwang2016 merged commit 3cadbe8 into dev Aug 11, 2016
@cwang2016 cwang2016 deleted the DM-7147-RegionBugs branch August 11, 2016 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants