Skip to content
Snippets Groups Projects
Commit 37e06853 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

reorder

parent a4470fba
No related branches found
No related tags found
1 merge request!2234Convert mask coords to bins before passing to detector (#823)
......@@ -350,20 +350,16 @@ void JobItem::importMasksFromDatafileItem()
void JobItem::convertMaskCoords()
{
// TODO add projections
const MaskContainerItem* container = m_realItem->data2DItem()->maskContainerItem();
if (!container)
return;
const Datafield* dfield = m_realItem->data2DItem()->c_field();
ASSERT(dfield);
MaskUnitsConverter mask_converter(dfield->frame());
// Masks conversion can be done in two steps: first from original coords to bins,
// then from bins to target coords.
// If 'IDetector::addBinMask' is used by detector, only "orig coords --> bins" is needed.
for (auto* maskItem : container->maskItems())
mask_converter.convertToNbins(maskItem);
if (const auto* container = m_realItem->data2DItem()->maskContainerItem())
for (auto* maskItem : container->maskItems())
mask_converter.convertToNbins(maskItem);
}
//! Crops DatafileItem to the region of interest.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment