editing NXtomo metadata#

As you can met wrong metadata (issue with bliss or nxtomomill) or if you want to ‘twist’ a dataset it can be interesting to get some hint to modify an NXtomo.


editing scalar values image0#

since tomwer 1.1 the nxtomo editor widget allow edition of some simple field (such as energy, sample / detector distance…)

[1]:
from IPython.display import YouTubeVideo

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

hand on - exercise A#

Copy one of your NXtomo 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 directly the ``tomwer nxtomo-editor`` command if you like


editing image_key#

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

hand on - exercise B#

invalid darks and flats frames of the crayon.nx NXtomo

note: you can use the tomwer image-key-editor command if you like

image-key editor imagekeyeditoricon#

edit image-key value frame by frame

[2]:
from IPython.display import YouTubeVideo

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

image-key upgrader imagekeyupgradericon#

edit image-key value by frame type directly.

From the upper part the user select the frame type (darks, flats,…) to be upgraded to another frame type. Once the scan encounter the widget this will edit (in place) the NXtomo.

image key upgrader interface

hand on - exercise C#

convert all ‘projection’ frames to ‘flats’ frames


editing NXtomo from python#

The simplest way to edit an NXtomo from python is either: