Input Format¶
The following documentation has been generated automatically from the comments found in the code.
-
class
Parameters_module.
Parameters
¶ The input variables are read from the input file. The input file is written with python syntax. The Input file is interpreted as python after a preprocessing The preprocessing was introduced at the time of HST-> PYHST transition to maintaing compatibility with:
NO/YES meaning 0/1
items containing FILE in their name can be initialized without using the “” which are otherwise necessary for strings
The input file has to set (some of) the following variables. To setup easily an input file you are suggested to start from one of the examples given in the doc.
-
BACKGROUND_DS_NAME
= None¶ the data set name for BACKGROUND inside the FILE_PREFIX in case of hdf5 The asked hdf5 datatype is native float : see discussion above for FILE_PREFIX
-
BACKGROUND_FILE
= ''¶ If the SUBTRACT_BACKGROUND option is active, set it to a file name , for example dark.edf. If it ends by .h5 it is considered as hdf5. Set in this case BACKGROUND_DS_NAME.
-
CORRECT_FLATFIELD
= 0¶ If set to 1, division by the flat-field (FF) is activated . Otherwise the FF files are not necessary.
-
CURRENT_NAME
= ''¶ if this variable is set then the current is read in the header of each radiography for the necessary normalisations.
-
DISTORTION_FILE
= None¶ This option defaults to None. No distortion correction will be made for the detector. If instead you pass a prefix for this option, let’s say
DISTORTIONS_FILE = mydist
then the horizontal distortion will be read from the file mydist_H.edf and the vertical one from mydist_V.edf
If only one of the file is present the other will be assmed to be zero everywhere.
-
DOUBLEFFCORRECTION
= 0¶ The double-ff-correction corrects the projection for the residual error that remains after FF correction. The origin of this residual error can be the effect of several causes, for example a detector non-linearity.
If let to zero, no correction is done. If set to a string (“filename” with quotes) then one image is read from the double-ff EDF file indicated in the string. The image must contain the logarithm of the correction factor. The data is subtracted from the treated projection.
-
FF_DS_NAME
= 'setthisfieldifyouusehdf5forffs'¶ the data set name for flat field inside the FILE_PREFIX in case of hdf5. The asked hdf5 datatype is native float : see discussion above for FILE_PREFIX
-
FF_FILE_INTERVAL
= 1500¶ The projection interval between FFs. If FF_NUM_FIRST_IMAGE = 0 , FF_NUM_LAST_IMAGE = 1500, and FF_FILE_INTERVAL = 1500 we have one FF for the first (number 0) projection and another for the projection number 1500. For the projection in between a linear interpolation is done.
-
FF_LENGTH_OF_NUMERICAL_PART
= 4¶ The fixed lenght (when it is fixed) of numerical part. The spaces are filled with zeros
-
FF_NUMBER_LENGTH_VARIES
= 0¶ If 1, the numerical part lenght is not fixed.
-
FF_NUM_FIRST_IMAGE
= 0¶ the number of the first FF. The value refers to the position in the file list. The MULTFRAME option does not apply yet to FFs.
-
FF_NUM_LAST_IMAGE
= 1500¶ The number of the last projection for which we have FF data.
-
FF_POSTFIX
= '.edf'¶ the postfix to be appended to FILE_PREFIX+number
-
FF_PREFIX
= 'refHST'¶ This is the prefix used to compose the FF filename. if it ends with .h5 it will be considered hdf5. In the latter case set also FF_DS_NAME which is the name of the 3D dataset from which FF will be read.
-
FILE_INTERVAL
= 1¶ The reconstruction is done with all the projection from NUM_FIRST_IMAGE to NUM_LAST_IMAGE with a step given by FILE_INTERVAL
-
FILE_POSTFIX
= '.edf'¶ the postfix to be appended to FILE_PREFIX+number
-
FILE_PREFIX
= None¶ this tells where the projection can be found. The projection name is obtained appending XXXX+FILE_POSTFIX to the prefix, where XXXX is the projection number whose format is given by the options below. When the MULTIFRAME options is activated, then only one data file for radiography is used and FILE_PREFIX is its name.
The only accepted file format so far is EDF/JPeg2000 and HDF5. For HDF5 format, FILE_PREFIX must end with “.h5”. In this case the radiographies are read from one single 3D dataset whose name is set by the PROJ_DS_NAME variable.
For Jpeg200 decompression is activated when JP2EDF_DIR is not None In this case the corresponding projections files (ending with .jp2) will be searched at paths given by FILE_PREFIX postpending .jp2 instead of .edf. The decompressed edf files will be written into JP2EDF_DIR
-
FLATFIELD_CHANGING
= 0¶ if set to 0 or NO, Then only one FF is read from FLATFIELD_FILE, and used to divide all the projections.
if set to 1, instead, several FF files are used, which are separated by a given number of projection. Division is done after linear interpolation.
-
FLATFIELD_FILE
= ''¶ This variable is used when FLATFIELD_CHANGING==0. It is the name of the EDF file containing the FF
-
JP2EDF_DIR
= None¶ in case of jp2 to edf decompression, edf files will be written in this directory. They will be deleted at the end if JP2EDF_REMOVE is 1.
-
JP2EDF_REMOVE
= 1¶ Remove or not edf decompressed (from jp2) files at the end.
-
LENGTH_OF_NUMERICAL_PART
= 4¶ The fixed lenght (when it is fixed) of numerical part. The spaces are filled with zeros
-
MULTIFRAME
= 0¶ If 0 (default) projection and flat-field data are to be found in sequences of edf files : one sequence for the projection, one sequence for flat-fields.
If 2 : one edf file for all the projections, one edf file for all the flat-fields. An edf file is expected, in this case, to contain a sequence of images, with one header per image.
If 1 : one edf file for all the projections, one edf file for all the flat-fields. An edf file is expected, in this case, to contain a 3D volume, consisting in a pile of images.
-
NUMBER_LENGTH_VARIES
= 0¶ If 1, the numerical part lenght is not fixed.
-
NUM_FIRST_IMAGE
= 0¶ the number of the first projection. The value may refer to the position in the file list or the position in a 3D stack (MULTIFRAME option)
-
NUM_LAST_IMAGE
= 0¶ the number of the last projection , inclusive : it means that if first,last==0,1999 there are 2000 projections
-
ONECLIPVALUE
= 10.0¶ After division by the FF, and before the logarithm, the data are clipped to this maximum
-
PROJ_DS_NAME
= 'setthisfieldifyouusehdf5forprojections'¶ the data set name for projections inside the FILE_PREFIX in case of hdf5. The asked hdf5 datatype is native float. It works if your data file is float but the conversion routine uint to float or ushort to float are not implemented in hdf5 and the documentation says that user routines for conversion can be complemented to HDF5 library by the user this is not yet done…
-
SUBTRACT_BACKGROUND
= 0¶ if you want to subtract a background from the projections set this to YES and set the following variable
-
ZEROCLIPVALUE
= 1e-09¶ After division by the FF, and before the logarithm, the data are clipped to this minimum