-
Notifications
You must be signed in to change notification settings - Fork 1
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
Re-coordinate data from other sources #4
Comments
Based on further conversations with Matt, he has said that the easiest workflow for them in terms of re-coordination would be:
Moreover, he has said that the option to enable/disable the ghost point feature is good and he would like it to stay. |
This work is currently being continued on the branch |
This was referenced Feb 13, 2024
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
As a TACTool user, I want to be able to recreate point locations from other sources (e.g. Scanning Electron Microscope exports) into TACTool image coordinates so that I can see where those locations lie on the images.
Description
Background
Many analytical instruments provide ways to export point locations as CSV files.
These locations are based on an internal coordinate reference system e.g. microns from the bottom left of the stage.
TACTool stores point locations in pixel coordinates.
When TACTool data are loaded into an instrument, the operator marks the position of the REF points in the instrument and the instrument uses these to convert the other coordinates into instrument coordinate reference system.
Here, we would like to convert data from instrument coordinates into TACTool pixel coordinates so that data points exported from the instrument can be overlain onto the image.
Coordinate conversion
The coordinate conversion needs to map the x, y coordinates of 3 points so that they match the x, y coordinates of 3 other points.
An SEM (or similar) instrument is able to rotate samples and zoom in and out, so the transformation should be a rotation and a stretch.
Matt has a spreadsheet that does the transformation, otherwise we can look it up. I'd be surprised if there isn't already a Python implementation.
I think it is an "affine transformation": http://en.wikipedia.org/wiki/Affine_transformation
Shapely has some functions that should help:
We could write a function that generates the transform function:
The transform function could be
df.apply()
'd to the analysis points in a CSV by a function like:TACTool implementation
We could have an extra option in the drop down menu - "Re-coordinate CSV".
This could open a dialog that takes a CSV file and an output CSV file name.
It can use that, plus the 3 REF points set on the TACTool canvas (dialog only enabled once they are set?) to convert the input CSV file and write it out into TACTool format, with TACTool pixel-based coordinates.
The source points for the transform come from the input CSV file, while the destination points are the ones in the current TACTool canvas. This means that the recoordinated CSV file has points that match up with the current TACTool canvas.
The user can open that file in a separate TACTool window to check that it works.
Acceptance criteria
The text was updated successfully, but these errors were encountered: