To improve the signal over background ratio (SBR) of a given image, we estimate the average noise in an image region containing a priori only background and we subtract it to the regions containing the signal.
In order to achieve such a laudable goal, we aim at being able to discriminate between 2 types of shapes: those containing signal and those containing noise. The final information will be the intensity difference between the averaged intensity in the signal shapes and in the noise shapes.
In practice, the user will have to choose a priori if the shape she is drawing corresponds to a signal shape or to a noise one. A different color will be associated to each shape according to its type (or role.)
The main modifications will consist in:
add a button in the tools bar to select the role of the shape to draw,
modify the list of data members of the Selection class. You could, either:
create a new data member m_noiseShapes of type std::vector<Shape*>, or
modify the m_shapes variable into a 2d array (e.g.: index 0 to store the signal shapes and index 1 for the noise ones. For clarity’s sake, one should probably use an enum such as: enum SHAPE_ROLE {SIGNAL=0, NOISE, NB_ROLES};)
std::vector< Shape* > m_shapes[NB_ROLES];
modify the Selection class to take into account this new information. Most of the methods of this class must be amended. For example:
Selection::AllocateShape(SHAPE_TYPE type);
should become:
Selection::AllocateShape(SHAPE_TYPE type, SHAPE_ROLE role);
apply the necessary modifications to allow the displayed color of a shape to be dependant on its role.
in the WStatistics dialog box, add a widget to display the difference of intensities between the average intensity in the signal shapes and the average intensity for the noise shapes. Such a modification can be performed on the wstatistics.ui file with Qt designer. Finally, apply the necessary modifications to update this item.