pytomography.io.simind - PyTomography 0.4.1 documentation

Hide navigation sidebar
Hide table of contents sidebar
Back to top
Toggle table of contents sidebar

# `pytomography.io.simind`

## Module Contents

### Functions

`find_first_entry_containing_header`(list_of_attributes, ...) | Finds the first entry in a SIMIND Interfile output corresponding to the header (header).
`simind_projections_to_data`(headerfile[, distance]) | Obtains ObjectMeta, ImageMeta, and projections from a SIMIND header file.
`simind_MEW_to_data`(headerfiles[, distance]) | Opens multiple projection files corresponding to the primary, lower scatter, and upper scatter windows
`simind_CT_to_data`(headerfile) | Opens attenuation data from SIMIND output
`get_SPECT_recon_algorithm_simind`(projections_header[, ...]) |

### Attributes

`relation_dict` |

pytomography.io.simind.relation_dict

pytomography.io.simind.find_first_entry_containing_header(list_of_attributes, header, dtype=np.float32)

  Finds the first entry in a SIMIND Interfile output corresponding to the header (header).

  Parameters:

    - list_of_attributes (list[str]) – Simind data file, as a list of lines.

    - header (str) – The header looked for

    - dtype (type, optional) – The data type to be returned corresponding to the value of the header. Defaults to np.float32.

  Returns:

    The value corresponding to the header (header).

  Return type:

    float|str|int

pytomography.io.simind.simind_projections_to_data(headerfile, distance='cm')

  Obtains ObjectMeta, ImageMeta, and projections from a SIMIND header file.

  Parameters:

    - headerfile (str) – Path to the header file

    - distance (str, optional) – The units of measurements in the SIMIND file (this is required as input, since SIMIND uses mm/cm but doesn’t specify). Defaults to ‘cm’.

  Returns:

    Required information for reconstruction in PyTomography.

  Return type:

    (ObjectMeta, ImageMeta, torch.Tensor[1, Ltheta, Lr, Lz])

pytomography.io.simind.simind_MEW_to_data(headerfiles, distance='cm')

  Opens multiple projection files corresponding to the primary, lower scatter, and upper scatter windows

  Parameters:

    - headerfiles (list[str]) – List of file paths to required files. Must be in order of: 1. Primary, 2. Lower Scatter, 3. Upper scatter

    - distance (str, optional) – The units of measurements in the SIMIND file (this is required as input, since SIMIND uses mm/cm but doesn’t specify). Defaults to ‘cm’.

  Returns:

    Required information for reconstruction in PyTomography. First returned tensor contains primary data, and second returned tensor returns estimated scatter using the triple energy window method.

  Return type:

    (ObjectMeta, ImageMeta, torch.Tensor[1, Ltheta, Lr, Lz], torch.Tensor[1, Ltheta, Lr, Lz])

pytomography.io.simind.simind_CT_to_data(headerfile)

  Opens attenuation data from SIMIND output

  Parameters:

    headerfile (str) – Path to header file

  Returns:

    Tensor containing CT data.

  Return type:

    torch.tensor[Lx,Ly,Lz]

pytomography.io.simind.get_SPECT_recon_algorithm_simind(projections_header, scatter_headers=None, CT_header=None, psf_meta=None, prior=None, object_initial=None, recon_algorithm_class=OSEMOSL)
  Parameters:

    - projections_header (str) –

    - scatter_headers (Sequence[str] | None) –

    - CT_header (str) –

    - psf_meta (pytomography.metadata.PSFMeta) –

    - prior (pytomography.priors.Prior) –

    - object_initial (torch.Tensor | None) –

    - recon_algorithm_class (torch.nn.Module) –

  Return type:

    torch.nn.Module