Tomo-tools training - Part 1: basic helical reconstruction¶

In this part, we see how to

  • Connect to ESRF compute infrastructure and activate the tomo-tools software
  • Get started with nabu-helical configuration files
  • Perform a basic helical reconstruction

Activating the tomo-tools software¶

Nabu-helical is part of Nabu, the activation process is the same - you have to enter a command to use it:

source /scisoft/tomotools/activate latest

The integration of Nabu-helical into Nabu exploits python and pycuda, on which Nabu is based.

With the goal of dealing with very large datasets some python classes of nabu-helical have been left, by design, on the CPU. This is done in order to fully exploit the host RAM $\simeq N ~\times~Tb$. The backprojection in particular remains on the GPU, its memory footprint remains limited by the fact that it is applied slice by slice. Other preprocessing step instead, are performed on the CPU.

To improve the performances some selected preprocessing classes have been translated to c++. They maintain the same API and can be seamlessy plugged into the master version. You can test this boosting by activating the following environment:

source /scisoft/tomotools/activate bm18_training_march_2023

Nothing changes except the speed.

Notice:¶

for maximal execution speed in the c++ accelerated parts you will profit from having required many cores. This is done with the --cpus-per-task argument in the allocation request.

1. Reconstruction using nabu-helical¶

In this part, we use the command line (nabu + nxtomomill) to perform a basic reconstruction.

There are roughly three steps:

  • Convert data (Bliss-HDF5 Spec-EDF) to Nexus : nxtomomill
  • Create and edit a nabu configuration file : nabu-config
  • Run the reconstruction : nabu-helical

1.1 - Converting a Bliss HDF5 acquisition scan to NX¶

For a basic helical scan the conversion to NX format is done in the same way as for the non-helical case. We will see more advanced command to convert z-stages into an helical scan. For this first part, we will be using the dataset: /scisoft/tomo_training/helica/HA-700_23.32um_apple_helical_0001 (scan of an apple, courtesy of Paul Tafforeau and Benoit Cordonnier, taken at bm18)

Hands-on: convert Bliss-H5 to Nexus¶

Use the command line nxtomomill to convert between (Bliss) HDF5 and NX layout. In the few lines below, to mantain a compact form of the command line, we use the variable tdd for the tomography dataset directory, and sn for the sample name:

tdd=/scisoft/tomo_training/helical/apple
sn=HA-700_23.32um_apple_helical_0001
nxtomomill h52nx $tdd/$sn/${sn}.h5 $sn.nx

1.2 - Generating a configuration file¶

To create a configuration file from scratch, the command-line tool nabu-config can be used:

nabu-config --helical 1 --output apple.conf --dataset $sn.nx

this creates a file apple.conf (nabu.conf would be the default) with pre-filled dataset location ( defaults to an empty slot)

To see all the parameters add --level advanced while for a minimalistic version use instead --level required

1.2.1 Further settings for finalising the configuration file¶

The important keys, specific to helical case, are discussed at this link. To finalise the configuration file you need to

  • set the Paganin options
  • set the processes_file parameter for weights map and double flat:
  • set rotation_axis_position
  • specify the output file/directory in the [output] section
  • select the reconstruction range either:
    • by:
      • start_z, end_z
    • or:
      • start_z_nn, end_z_mm

1.2.2 - Rotation axis position¶

A command line utility nabu-composite-cor provides a roboust algorithm for cor finding. The actual version applies to standard tomography scan, and can be used also for helical scans when they have a first part of the acquisition which is done at fixed z translation. The actual bliss helical scan have this property. If there is enough information in this first part the algorithm will work. The full documentation can be found at this link. It has a full set of features which makes it suited for dealing also with z-series, but for our present case it usage can be as simple as

nabu-composite-cor --filename_template ${sn}.nx \
--cor_options "side='near'; near_pos = 700.0; near_width = 20.0"

which writes the cor, or the list of cors for z-series, in the default output file:

Processes file¶

We create the file containing the weights map and default double flat field. the weights will be based on the flats of the dataset. The double flat-filed will be set to one. We do this with the following instruction

transition_width=60
    nabu-helical-prepare-weights-double \
    $sn.nx \
    entry0000 \
    weights_and_double.h5 \
    $transition_width

The fourth and fifth arguments are optional. The transition_width, which defaults to 50 pixel, determines how the weights are apodised near the upper and lower border. The name of the produced file must be provided in the preproc section:

   [preproc]
   ...
   processes_file =  weights_and_double.h5

1.3 - Helical reconstruction¶

Let's run our first reconstruction.

to select a vertical reconstruction range it may be very useful to get informations about the doable vertical span. This is done with the following command:

nabu-helical apple.conf --dry_run 1

        Doable vertical span
        --------------------
             The scan has been performed with an descending vertical 
             translation of the rotation axis.

             The detector vertical axis is up side down.

             Detector reference system at iproj=0:
                from vertical view height  ...   -2830
                up to  (included)     ...   543

                 The slice that projects to the first line of the first projection 
                 corresponds to vertical heigth = 0

             In voxels, the vertical doable span measures: 3373.0

             And in millimiters above the stage:
                 from vertical height above stage ( mm units)  ...   49.66862
                 up to  (included)                                ...  128.32698



Exercise¶

Read the documentation at this link. about start_z_mm and end_z_mm. Then, knowing that the scan starts approximatively at the bottom of the apple, guess the start_z_mm and end_z_mm to reconstruct the seeds.(Hint: market preferences for apples).

Finally to reconstruct

The syntax is nabu-helical apple.conf