-
Notifications
You must be signed in to change notification settings - Fork 31
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
Z-offset attribute label #521
Conversation
src/js/models/panel_model.js
Outdated
if(!isNaN(shift)){ | ||
deltaZ = theZ + shift; | ||
} | ||
} | ||
if (format === "pixel") { | ||
text = "" + (theZ + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if you could also use deltaZ
instead of theZ
here, so that you can use offset
when showing Z index.
And if you could apply the same change to theT
that would be great.
There's maybe not much use case for that (I only noticed it in testing) but that's still the way you'd expect it to behave.
In my test, the white labels (offset=2) show the same as yellow labels (no offset):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok make sense.
Is it what you had in mind ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, no! I just meant for that line to be text = "" + (deltaZ + 1);
instead of text = "" + (theZ + 1);
That's all! Apologies for the confusion!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah...Ok, now I see. No worries, I didn't correctly read.
I've corrected it. I also correct a small bug on time offset (see below) but I noticed that the current implementation doesn't allow for negative offsets for time (but allowed for Z)
var shift = this.get('deltaT')[shiftIdx];
deltaT = shift==null ? deltaT : shift;
Do we also allow it for time ?
…offset and fix bug on time offset
Thanks for your detailed explanation. For the consistency, I have few more questions
I would go to modify the restriction forced by |
Time is a bit more tricky than
The event of interest starts at 3 hours, so the user will enter
If we did the same as for Z, were we subtract
The trouble with using this technique |
I also just remembered that whatever we do in the JavaScript app, we also have to replicate in the We don't want to change the |
The problem we have with existing T-offset behaviour is that |
Hi @will-moore, I finally manage to find time to get back to this. Edit: I created a new PR to fix the time index offset that didn't update because of the |
Hi, since we're going for different behaviour than for T offset, we need a different way of describing it in the info panel. Something like: Z index with units, offset by the Z pixel size x 3 Does that make sense? |
Hi @will-moore, |
<td>Z: [z.unit; offset=3]</td> | ||
<td>Z: -3.00 µm </td> | ||
</tr> | ||
<tr> | ||
<th>Z slice with index position <br/>relative to the 3rd frame</th> | ||
<th>Z index with (first plane is Z: 1) <br/>offset by 3</th> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, thanks. !
This is a typo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
Works as expected on merge-ci. The lines in the Tips examples are formatted ok, and, although they are showing theoretical values, one might argue that you can deduce by playing with the feature, whilst starting from the example the behaviour and adjust it for your purposes. The label is dynamic which is a great strenght. Thank you @Rdornier LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Traceback (most recent call last):
File "./script", line 2537, in <module>
run_script()
File "./script", line 2523, in run_script
file_annotation = export_figure(conn, script_params)
File "./script", line 2479, in export_figure
return fig_export.build_figure()
File "./script", line 978, in build_figure
self.add_panels_to_page(panels_json, image_ids, page)
File "./script", line 1977, in add_panels_to_page
self.draw_labels(panel, page)
File "./script", line 1277, in draw_labels
label_value = (z_pos + " " + z_symbol)
TypeError: can only concatenate str (not "NoneType") to str
When executing the Figure_to_Pdf.py script.
Sorry, I can see some probs with Pdf export script @Rdornier - see #521 (review) cc @will-moore See figure https://merge-ci.openmicroscopy.org/web/figure/file/12325/ user-3. Panel edited is the one in the last row which is moved slightly off |
That error seems not related to this PR. The panel is missing
gives
That code was added in https://github.com/ome/omero-figure/pull/472/files, which also included code to populate that field when adding images to the figure, but this panel was probably added before that PR. If you add that Image to a new figure, it won't give you this error. I'll open a different PR to fix that. |
Should fix the issue #513 for
labels "Z:[z.unit; offset=2]"
.For
z.pixel
attribute, the offset is not taken into account in order to be coherent with the time stamps labels behavior.