Skip to content
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

Allow dimensions in NXdata to be lists of strings #1246

Merged
merged 15 commits into from
Dec 20, 2023
32 changes: 32 additions & 0 deletions base_classes/NXdata.nxdl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,38 @@
the axes attribute can be omitted.
</doc>
</attribute>
<attribute name="default_slice">
<doc>
Which slice of data to show in a plot by default. This is useful especially for
datasets with more than 2 dimensions.

Should be an array of strings of length equal to the number of dimesions
phyy-nx marked this conversation as resolved.
Show resolved Hide resolved
in the data, with the following possible values:
* ".": All the data in this dimension should be included
* Integer: Only this slice should be used.
woutdenolf marked this conversation as resolved.
Show resolved Hide resolved
* String: Only this slice should be used. Use if AXISNAME_indices is a string
phyy-nx marked this conversation as resolved.
Show resolved Hide resolved
array.

Example::

data: NXdata
@signal = "data"
@axes = ["image_id", "channel", ".", "."]
@image_id_indices = 0
@channel_indices = 1
@default_slice = [".", "difference", ".", "."]
image_id = [1, ..., nP]
channel = ["threshold_1", "threshold_2", "difference"]
data = uint[nP, nC, i, j]
phyy-nx marked this conversation as resolved.
Show resolved Hide resolved

Here, a data array with four dimensions, including the number of images
(nP) and number of channels (nC), specifies more dimensions than can be
visualized with a 2D image viewer for a given image. Therefore the
default_slice attribute specifies that the "difference" channel should be
shown by default.

</doc>
</attribute>
<attribute name="AXISNAME_indices" type="NX_INT">
<!--
nxdl.xsd rules do not allow us to show this as a variable name
Expand Down