BIOP / bigdataviewer-biop-tools

Another repo for bdv tools.
5 stars 2 forks source link

Timepoint slider bug? #23

Closed tischi closed 3 years ago

tischi commented 3 years ago

@NicoKiaru Camilla (see E-mail) reported:

When showing sources in a new window we did not have the option to chose more timepoints, and there is no slider on the bottom of the window to slide through the timepoints.

Do you know what this could be about?

NicoKiaru commented 3 years ago

I think it' related to the default BdvHandle supplier. The default one has really very little options available.

The idea was to make this supplier modular, so you can add any features to it (like a Z Slider, an editor mode, etc). We can pimp the default one, but making one that fits your need is the prefered.

It's actually tricky to know how many timepoints there are a SourceAndConverter - if it is attached to a SpimData object it's doable, but otherwise it's tricky. Some source are 'infinite over time': they just return the same source whatever is the timepoint. So how do you do in this case ? You can't make an infinite time slider.

See this function also: https://github.com/bigdataviewer/bigdataviewer-playground/blob/d0db4c18218bb744f464de5167fd279eea873cf6/src/main/java/sc/fiji/bdvpg/sourceandconverter/SourceAndConverterHelper.java#L415-L457

NicoKiaru commented 3 years ago

FYI there is a 'set number of timepoints' command which can at least put the number of timepoint of want

tischi commented 3 years ago

there is a 'set number of timepoints' command which can at least put the number of timepoint of want

I tried this, but I think if there is only one time point to start with it does not work, because then there is no slider at all.

This is code in the playground, isn't it?

Didn't we have some code that tries to figure out how many timepoints an SAC has? In my use case it is an SAC that is derived from an ImagePlus.

I would propose the following:

In the playground in public class BdvSourcesShowCommand implements BdvPlaygroundActionCommand there is this line: bdvh = sacDisplayService.getNewBdv();

I would make a function sacDisplayService.getNewBdv( numTimepoints ); And then try to figure out how many time points the sac to be displayed has and then use that number there.

What do you think?

NicoKiaru commented 3 years ago

I tried this, but I think if there is only one time point to start with it does not work, because then there is no slider at all.

Weird, I did it several times. AH, I know! You need to click the bdv window in the list. Don't assume it's selected!

Yes, the code is in the playground

NicoKiaru commented 3 years ago

Didn't we have some code that tries to figure out how many timepoints an SAC has? In my use case it is an SAC that is derived from an ImagePlus.

Yes, the code I linked tries to figure it out in a general manner

NicoKiaru commented 3 years ago

I would make a function sacDisplayService.getNewBdv( numTimepoints );

I wouldn't do it. It will break many things I'm pretty sure.

tischi commented 3 years ago

AH, I know! You need to click the bdv window in the list. Don't assume it's selected!

OK. Works for me, too now!

Maybe then that's just the solution?!

NicoKiaru commented 3 years ago

This caused many troubles already, I ll modify the 'set timepoints' command to take only one bdv which will be filled by the preprocessor

NicoKiaru commented 3 years ago

There's a new "BDV - Set Number Of Timepoints (current window)" command now