Editing NXtomo Metadata#

As you can encounter wrong metadata (issue with bliss or nxtomomill) or if you want to ‘twist’ a dataset, it can be interesting to get some hints on how to modify a NXtomo.


Editing Scalar Values image1#

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

[1]:
from IPython.display import YouTubeVideo

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

Hands-on - Exercise A#

Copy one of your NXtomo files or copy the ‘crayon.nx’ file from /scisoft/tomo_training/part6_edit_nxtomo and set:

  • energy to 60.2 keV

  • distance to 1.2 cm

Note: You can use the ``tomwer nxtomo-editor`` command directly if you like.


Editing image_key#

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

  • projection = 0

  • flat field = 1

  • dark field = 2

  • invalid = 3

A common operation is to change the image_key to ignore some frames (with noise, for example) or modify projections to flat (see part 3). For this, you can use the image-key-upgrader or the image-key-editor.

Hands-on - Exercise B#

Invalid darks and flats frames of the crayon.nx NXtomo

Note: You can use the ``tomwer image-key-editor`` command directly if you like.

Image-key Editor imagekeyeditoricon#

Edit image-key values frame by frame.

[2]:
from IPython.display import YouTubeVideo

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

Image-key Upgrader imagekeyupgradericon#

Edit image-key values by frame type directly.

From the upper part, the user selects the frame type (darks, flats, etc.) to be upgraded to another frame type. Once the scan encounters the widget, it will edit (in place) the NXtomo.

image key upgrader interface

Hands-on - Exercise C#

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


Editing NXtomo from Python#

The simplest way to edit a NXtomo from Python is either: