Closed tischi closed 3 years ago
Hum, ok, maybe one of these 0 vs 1 index base story.
Will you have a look or shall I?
@NicoKiaru Hm, we have some not reproducible situation. I have the feeling that this method:
SourceAndConverterHelper
public static int getMaxTimepoint(SourceAndConverter<?> sac)
....sometimes does not return the correct number of time points even though we can see all of them in the BDV window. Do you have any suspicion?
Aha, maybe it is the following:
public static int getMaxTimepoint(SourceAndConverter<?> sac)
...
if (!sac.getSpimSource().isPresent(0)) {
return 0;
}
Maybe some sources are initialized with 1
being the first time point and not 0
?
I found something weird:
Maybe your code fails for sources where the number of time points is a multiple of 2?
@NicoKiaru (ping in case you did not get notified anyway)
I think this can simply be fixed by adding a +1
to the for loop.
for (int tp = previous;tp<iFrame+1;tp++)
If you agree, I would be grateful if you could just make the change such that we don't have to go through the whole PR stuff 😃
While we do this, I think we should also rename nFrames
to maxFrame
to avoid confusion.
0,1,2,3,4: nFrames = 5; maxFrame =4
I realize now that in fact you are returning numFrames
, which means that maybe the name of the method is wrong? getMaxTimepoint
should be getNumTimepoints
?!
@NicoKiaru Just add 1:
was:
for (int tp=previous;tp<iFrame;tp++)
should be:
for (int tp=previous;tp<iFrame+1;tp++)
I do not observe any issue with the command and dataset with timepoints:
In the command, the timepoint is 0 based. Maybe that's where your issue comes from ?
You can test by having a data set with 16 time points.
Thanks! Good catch!
Thanks for the fix! I think we should also change the examples in the Command UI to be zero based! This would be much less confusing for the users.
I changed the comments in the UI in the 'basic export current view blabla'. Did I miss other places?
I think that was the main place. Thanks ❤️ BTW: I am on holidays now for a week 🌴 😄
@NicoKiaru Are those fixes already on the update site?
No the bigdataviewer-playground update site is old. You can use ABBA for now. But there's a paper coming so I need to update the bigdataviewer-playground update site this week.
@NicoKiaru On ABBA update site the example is still wrong:
The examples should be zero based.
oki doki
@NicoKiaru
The exporter seems to have an issue with images that have more than one timepoint.
Do you have time to fix this or should I give it a go?