Editing NXtomo Metadata#

When dealing with incorrect metadata (for example, issues with Bliss or Nxtomomill) or when you need to adjust a dataset, it can be helpful to know how to modify an NXtomo file.

This tutorial focuses exclusively on the options available through the Graphical User Interface (GUI). However, you also have the option to edit an NXtomo directly using the Python API.


Editing Scalar Values image1#

Since Tomwer 1.1, the nxtomo editor widget allows editing of some simple fields (such as energy, sample/detector distance, etc.).

[1]:
from tomwer.resources.video import Video

Video("KwwCYXnP3YI", height=500, width=800)
[1]:

Hands-on Exercise A#

Edit the NXtomo contained in /data/projects/tomo-sample-data/training/workspaces/[date]/[user_id]/PROCESSED_DATA/edition/crayon.nx. Define:

  • Energy to 60.2 keV

  • Sample-detector distance to 1.2 cm

Hint: You can also use the tomwer nxtomo-editor [file] [entry] command directly if you prefer.


Editing image_key#

The NXtomo image_key field is used to determine the type of each frame. Possible types are:

  • projection = 0

  • flat field = 1

  • dark field = 2

  • invalid = 3

A common operation is to change the image_key to ignore certain frames (for example, those with excessive noise) or modify projections to flats (see Part 3).

To do this, you can use either the image-key-upgrader or the image-key-editor.

Hands-on Exercise B#

Invalid dark and flat frames in the crayon.nx NXtomo.

Hint: You can use the tomwer image-key-editor command if you prefer.

image-key Editor imagekeyeditoricon#

Edit the image_key value frame by frame.

[2]:
from tomwer.resources.video import Video

Video("4yrEBrAmwtY", height=500, width=800)
[2]:

image-key Upgrader imagekeyupgradericon#

Edit image_key values by frame type directly.

At the top, the user selects the frame type (e.g., darks, flats, etc.) to be upgraded to another frame type. Once the scan encounters the widget, it will edit the NXtomo in place.

image key upgrader interface

Hands-on Exercise C#

Convert all ‘projection’ frames to ‘flats’ frames.