tomwer.core.scan.nxtomoscan.NXtomoScan#
- class tomwer.core.scan.nxtomoscan.NXtomoScan(scan, entry, index=None, overwrite_proc_file=False)#
This is the implementation of a TomoBase class for an acquisition stored in a HDF5 file.
For now several property of the acquisition is accessible thought a getter (like get_scan_range) and a property (scan_range).
This is done to be compliant with TomoBase instantiation. But his will be replace progressively by properties at the ‘TomoBase’ level
- Parameters:
scan (str | None) – scan directory or scan masterfile.h5
- clear_caches()#
clear caches. Might be call if some data changed after first read of data or metadata
- data_flat_field_correction(data, index=None)#
Apply flat field correction on the given data
- Parameters:
data – the data to apply correction on
index – index of the data in the acquisition sequence
- Returns:
corrected data
- static directory_contains_scan(directory, src_pattern=None, dest_pattern=None)#
Check if the given directory is holding an acquisition
- Parameters:
directory – directory we want to check
src_pattern – buffer name pattern (‘lbsram’)
dest_pattern – output pattern (‘’). Needed because some acquisition can split the file produce between two directories. This is the case for edf, where .info file are generated in /data/dir instead of /lbsram/data/dir
- Returns:
does the given directory contains any acquisition
- static entry_is_nx_tomo(entry)#
- property ff_interval#
- static from_dict(_dict)#
- static from_identifier(identifier)#
Return the Dataset from a identifier
- get_detector_url()#
compute and return the url where the detector data can be found
- Return type:
DataUrl | None
- get_identifier()#
return the dataset identifier of the scan. The identifier is insure to be unique for each scan and allow the user to store the scan as a string identifier and to retrieve it later from this single identifier.
- get_nabu_dataset_info(binning=1, binning_z=1, proj_subsampling=1)#
- Returns:
nabu dataset descriptor
- static get_nxtomo_entries(file_path)#
- Return type:
tuple
- get_proj_angle_url(use_cache=True, with_alignment=True)#
retrieve the url for each projections (including the alignment / return one) and associate to each (if possible) the angle. Alignment angle are set as angle (1) to specify that this is an alignment one. :type use_cache:
bool
:param use_cache: :return: dictionary with angle (str or int) as key and url as value
- get_proposal_name()#
- Return type:
str | None
- get_sinogram(line, subsampling=1, norm_method=None, **kwargs)#
extract the sinogram from projections
- Parameters:
line – which sinogram we want
subsampling – subsampling to apply on the sinogram
- Returns:
sinogram from the radio lines
- property helical#
- is_abort(src_pattern, dest_pattern)#
Check if the acquisition have been aborted. In this case the directory should contain a [scan].abo file
- Parameters:
src_pattern – buffer name pattern (‘lbsram’)
dest_pattern – output pattern (‘’). Needed because some acquisition can split the file produce between two directories. This is the case for edf, where .info file are generated in /data/dir instead of /lbsram/data/dir
- Returns:
True if the acquisition have been abort and the directory should be abort
- is_finish()#
- static is_nexus_nxtomo_file(file_path)#
- Return type:
bool
- static is_nxdetector(grp)#
Check if the grp is an nx detector
- Parameters:
grp (
Group
) –- Returns:
True if this is the definition of a group
- load_from_dict(_dict)#
Load properties contained in the dictionary.
- Parameters:
_dict – dictionary to load
- Returns:
self
- Raises:
ValueError if dict is invalid
- projections_with_angle()#
projections / radio, does not include the return projections
- scan_basename()#
return basename of the directory containing the acquisition
- scan_dir_name()#
return name of the directory containing the acquisition
- Return type:
str | None
- scan_parent_dir_basename()#
return parent basename of the directory containing the acquisition
- to_dict()#
- Return type:
dict
- Returns:
convert the TomoScanBase object to a dictionary. Used to serialize the object for example.
- to_nabu_dataset_analyser()#
Return the equivalent DatasetAnalyzer for nabu
- update()#
update list of radio and reconstruction by parsing the scan folder
- property working_directory#
working directory to use for this scan (for launching reconstruction for example)