vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
vitrio::counting_detector_event_renderer Class Referencefinal

A renderer that counts the events landing on each pixel. More...

#include <vitrio/counting_detector_event_renderer.hpp>

Inheritance diagram for vitrio::counting_detector_event_renderer:
Inheritance graph
[legend]
Collaboration diagram for vitrio::counting_detector_event_renderer:
Collaboration graph
[legend]

Public Member Functions

 counting_detector_event_renderer (detector_event_binning binning) noexcept
 Construct a renderer gathering the pixels a binning merges.
 
const detector_event_binning & get_binning () const noexcept
 Get how many pixels of the detector a pixel gathers.
 
std::vector< std::size_t > get_image_extents (const detector_event_timeline_descriptor &events) const override
 Get the extents of the images rendered from an acquisition.
 
numerical_type get_data_type () const noexcept override
 Get the data type images are worked out in.
 
void render (const detector_event_timeline_descriptor &descriptor, const detector_event_timeline &events, array_ref destination) const override
 Render events into an image.
 
- Public Member Functions inherited from vitrio::detector_event_renderer
 detector_event_renderer (const detector_event_renderer &other)=delete
 
 detector_event_renderer (detector_event_renderer &&other)=delete
 
detector_event_renderer & operator= (const detector_event_renderer &other)=delete
 
detector_event_renderer & operator= (detector_event_renderer &&other)=delete
 

Detailed Description

A renderer that counts the events landing on each pixel.

A pixel of the image gathers a block of pixels of the detector, as many as its detector_event_binning says along each axis, and counts every event that fell on any of them, wherever within the pixel it was placed.

Counts are worked out as 32 bit unsigned integers.

Constructor & Destructor Documentation

◆ counting_detector_event_renderer()

vitrio::counting_detector_event_renderer::counting_detector_event_renderer ( detector_event_binning  binning)
explicitnoexcept

Construct a renderer gathering the pixels a binning merges.

Parameters
binningHow many pixels of the detector a pixel of the image gathers along each axis.

Member Function Documentation

◆ get_binning()

const detector_event_binning & vitrio::counting_detector_event_renderer::get_binning ( ) const
noexcept

Get how many pixels of the detector a pixel gathers.

Returns
const detector_event_binning& The binning.

◆ get_data_type()

numerical_type vitrio::counting_detector_event_renderer::get_data_type ( ) const
overridevirtualnoexcept

Get the data type images are worked out in.

Rendering into an image of that type converts nothing, which makes it the cheapest to ask for.

Returns
numerical_type The data type. Never unknown.

Implements vitrio::detector_event_renderer.

◆ get_image_extents()

std::vector< std::size_t > vitrio::counting_detector_event_renderer::get_image_extents ( const detector_event_timeline_descriptor &  events) const
overridevirtual

Get the extents of the images rendered from an acquisition.

Parameters
eventsThe grid the events are placed on.
Returns
std::vector<std::size_t> The extents of an image, slowest axis first.
Exceptions
std::invalid_argumentIf this renderer can not render events placed on the grid of events.

Each extent is that of the detector, in pixels, divided by the factor of the binning.

Implements vitrio::detector_event_renderer.

◆ render()

void vitrio::counting_detector_event_renderer::render ( const detector_event_timeline_descriptor &  descriptor,
const detector_event_timeline &  events,
array_ref  destination 
) const
overridevirtual

Render events into an image.

Every element of destination is written, whatever it held before. Values are converted to its data type as a cast between the two types does.

Parameters
descriptorThe grid the events are placed on and the time they span.
eventsThe events to render. Must have the rank of descriptor, and every coordinate must lie within its extents.
destinationWhere the image is written. Must be initialized and have the extents get_image_extents gives for descriptor. It may be strided.
Exceptions
std::invalid_argumentIf this renderer can not render events placed on the grid of descriptor, if events does not have its rank, or if destination is not initialized or does not have the extents of an image.
std::out_of_rangeIf an event lies outside the grid of descriptor.
unsupported_operation_errorIf the data type of destination can not be produced from that of get_data_type.
std::overflow_errorIf a pixel gathers more events than 32 bits count.

Implements vitrio::detector_event_renderer.


The documentation for this class was generated from the following file: