Comments (10)
@jllamas This problem is fixed and updated in Github. I tightly limit the pixels for which RGB colors are calculated (for speed) and this limit needed to be extended in cases where non-square images were rotated and displayed in non-square displays, as in your case. I also fixed a typo that caused the panner to go awry in this case.
Because rotation first sets up a transformation maxtrix that gets applied to the display canvas and then redisplays the image, it's tricky to support rotate:90 in the opts object at Load time. In javascript you can just use the onload function:
JS9.Load(file, {onload: (im) => {
JS9.SetRotate(90, {display: im});
}});
Let me know if you have problems ...
from js9.
@jllamas OK, I believe I have fixed this issue and also fixed some related problems with the panner plugin. It's all updated in GitHub, so "git pull" will get the latest, assuming you cloned.
from js9.
@jllamas Are you using the Montage RotateDats() reprojection call or the cheaper SetRotate() call? And can I get a copy of the FITS file, so that I don't have to dummy up the data? I suspect I didn't work hard enough at changing the dimensions of the image ...
from js9.
Hey Eric,
You can use the same FITs from my other ticket https://caltech.box.com/s/8t1hbyvsztu1w5l9nvig25kmer74qrjt
We are using JS9.SetRotate()
ala:
function rotateFits() {
if (JS9.GetLoadStatus() == "complete") {
JS9.SetRotate(-90);
} else {
setTimeout(rotateFits, 300);
}
}
from js9.
@jllamas Ah, thanks, I should have remembered that I have one of your FITS files already. I'll look at this tomorrow.
from js9.
Hello Eric,
We've deployed the new code (I ended up downloading 3.6 from the website as opposed to github) and it works great!
Clicking zoom (-) shows more! Great!
However clicking the last zoom button, which I would expect to fill the screen to the max boundary. JS9 zoom it even further (-), instead of filling the width.
Please let us know if that last item is a bug or expected, otherwise we can close this issue.
Thank you very much!
Jacob
from js9.
@jllamas Hi Jacob, it looks right to me, in the sense that going to zoom 1/16 causes the pixels to be resampled by another factor of two, and therefore the image size is reduced by 2 in both width and height. You can see this easily with the Panner plugin ... btw, have you tried zoom to fit? Does that give you the full display you want?
That said, I do wonder what you are expecting ... there may be a nuance I'm missing here.
from js9.
@ericmandel yeah in the last image above I clicked the 'zoom to fit', and compared to where I was in the middle picture it zoomed out further.
I opened a local fits file, and clicked 'zoom to fit' and it did as expected, filling the view port to the first maximum boundry. The dynamically loaded and rotated image 'zoom to fit', as guess, seems to be using the width before the rotation where its tall and skinny?
from js9.
@jllamas Ah, right, zoomToFit was not taking the rotation into account at all. I have this working on my development machine, but I want to have a look at the panner plugin before I update, there is something not quite right there as well ...
from js9.
I've updated JS9 in our app, and everything works as expected. Thank you!
from js9.
Related Issues (20)
- Conflicting CSS HOT 3
- Loading files from the server with the node helper HOT 14
- Javascript API HOT 2
- Load multi extension tile compressed fits report error. HOT 9
- JS9.Load("file", {ra: 0, dec: 0}) doesn't pan HOT 3
- Missing reference in CSS file "tabcontent.css" HOT 3
- Unable to Load FITS files with NaN values HOT 12
- JS9 ERROR: cannot load: ../astroemw.wasm ... please check the url/pathname HOT 3
- Multi Extension FITs mosaic display HOT 12
- JS9 potentially crashing on ARM64 architecture HOT 8
- JS9.ChangeRegions() to change position incorrect after zooming image HOT 5
- Incorporating JS9 (and pyjs9) into a JupyterLab -> Kubernetes/Docker system HOT 2
- Release with bundled minimist bump? HOT 3
- Q: is there a query parameters to load image from CORS server? HOT 16
- ImageOpts.flip does nothing HOT 3
- Load image from memory. HOT 4
- End of JS9 development: July 1, 2022 HOT 2
- Preload regions with image HOT 3
- unable to open some files HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js9.