CARTAvis / carta

To CARTA users, this repo holds the CARTA release packages. Please use this repo to log bugs and feature requests. These will be triaged by the development team and prioritised as necessary in the development cycles.
19 stars 0 forks source link

play with 2 or more cubes refresh only active image #180

Closed kgolap closed 10 months ago

kgolap commented 1 year ago

Describe the bug When playing (hitting play button on the animator) 2 or more cubes. only the active cube gets played. When it is stopped all the cubes then move the the channel moved. When the step button is used all the images move to the next channel.

To Reproduce Steps to reproduce the behavior:

  1. load 2 cubes (or more) with the same coordinates and shapes
  2. open the animator and hit the play button for channel activated as the axis to play a movie
  3. you'll notice only the active image being played in a movie the others remain frozen
  4. when you stop all the images refresh to the last channel reached
  5. When hitting "next" channel button all the images refresh to the next channel

Expected behavior All images that are matched in spectral coordinate should move along in the movie

kswang1029 commented 1 year ago

Thanks for reporting this. This is a “side-effect” right after we implemented the multiple-panel view feature. Performance-wise, it is a bit tricky. We will try to fix it after the coming v4-beta release.

For now, we can use the JS code snippets to emulate the expected behavior. I will provide an example shortly.

kswang1029 commented 1 year ago

@kgolap for now you may use the JS code snippet to emulate the desired animation playback. You can try

  1. go to File -> Preferences and enable code snippet
  2. then there will be a new item "Snippet" in the menu bar
  3. load your images and match them spatially and spectrally
  4. open the snippet editor and enter the following and execute it:
let start_ch = 80;
let end_ch = 114;
let desired_fps = 2 // better use this to avoid throttling

for (let i = start_ch; i <= end_ch; i++){
    await carta.delay(1.0/desired_fps*1000);
    // setChannels is throttled so a high(er) desired_fps will result in skipped channels
    app.activeFrame.setChannels(i, 0, true);
}

Then you should see something like the following video.

https://user-images.githubusercontent.com/20819712/227111120-bf7fa8b1-387d-4320-8a14-ba52f36c6cca.mov

kgolap commented 1 year ago

Thanks @kswang1029 this snippet works for my purpopse.

kswang1029 commented 10 months ago

Now this should have been addressed in the v4-stable release.