class for making visual stimuli More...
#include <Psycho/StimMaker.H>
Public Member Functions | |
StimMaker (const unsigned short ImageSizeX, const unsigned short ImageSizeY, const unsigned short frameCount, const char bgColor) | |
Init the stim maker with the image size and number of frames. | |
~StimMaker () | |
default destructor | |
void | SM_init (const char bgColor) |
re-init the frames to the background color | |
void | SM_setStandardBackGround (const unsigned char bgColor) |
reset the frames and back ground truth to the background color | |
void | SM_overRideRates (const unsigned char slowRate, const unsigned char fastRate, const unsigned char stopRate) |
override the built in blink rates of stimuli | |
void | SM_setCustomColors (const PixRGB< float > BGcolor, const PixRGB< float > TargetColor, const PixRGB< float > DistColor) |
overide the built in color sets for target and distractors | |
ushort | SM_speedUpCheck (ushort currBlinkRate, const ushort frame, const ushort changeFrame, const unsigned char stimRate, const unsigned char useSmoothRateChange) const |
check if we need to speed up the blink rate | |
ushort | SM_speedDownCheck (ushort currBlinkRate, const ushort frame, const ushort changeFrame, const unsigned char stimRate, const unsigned char useSmoothRateChange) const |
check if we need to slow down the blink rate | |
void | SM_drawGroundTruth (const ushort frame, const unsigned char stimSizeX, const unsigned char stimSizeY, const ushort PosX, const ushort PosY, const bool targetOn) |
draw a steady patch where the ground truth is | |
void | SM_drawSingleTarget (const ushort frame, const unsigned char stimShape, const unsigned char stimColor, const unsigned char stimSizeX, const unsigned char stimSizeY, const ushort PosX, const ushort PosY, const float stimOri, const float shapePositionJitter, const float shapeOrientationJitter, const bool target) |
draw a single object in the frame and ground truth image | |
void | SM_makeUniformStim (const StimMakerParam &stim) |
create a new stim movie with the provided params | |
std::vector< Image< PixRGB < float > > > | SM_getStim () const |
get the stim series back | |
std::vector< Image< PixRGB < float > > > | SM_getGroundTruth () const |
get back the ground truth image |
class for making visual stimuli
Definition at line 45 of file StimMaker.H.
StimMaker::StimMaker | ( | const unsigned short | ImageSizeX, | |
const unsigned short | ImageSizeY, | |||
const unsigned short | frameCount, | |||
const char | bgColor | |||
) |
Init the stim maker with the image size and number of frames.
Definition at line 44 of file StimMaker.C.
References PixRGB< T >::set(), and SM_init().
StimMaker::~StimMaker | ( | ) |
default destructor
Definition at line 88 of file StimMaker.C.
void StimMaker::SM_drawGroundTruth | ( | const ushort | frame, | |
const unsigned char | stimSizeX, | |||
const unsigned char | stimSizeY, | |||
const ushort | PosX, | |||
const ushort | PosY, | |||
const bool | targetOn | |||
) | [inline] |
draw a steady patch where the ground truth is
Definition at line 231 of file StimMaker.C.
References drawDisk().
Referenced by SM_makeUniformStim().
void StimMaker::SM_drawSingleTarget | ( | const ushort | frame, | |
const unsigned char | stimShape, | |||
const unsigned char | stimColor, | |||
const unsigned char | stimSizeX, | |||
const unsigned char | stimSizeY, | |||
const ushort | PosX, | |||
const ushort | PosY, | |||
const float | stimOri, | |||
const float | shapePositionJitter, | |||
const float | shapeOrientationJitter, | |||
const bool | target | |||
) | [inline] |
draw a single object in the frame and ground truth image
Definition at line 254 of file StimMaker.C.
References color, drawArrow(), drawCircle(), drawCrossOR(), drawDisk(), drawPatch(), drawRectOR(), and Rectangle::tlbrI().
Referenced by SM_makeUniformStim().
std::vector< Image< PixRGB< float > > > StimMaker::SM_getGroundTruth | ( | ) | const |
get back the ground truth image
Definition at line 1068 of file StimMaker.C.
std::vector< Image< PixRGB< float > > > StimMaker::SM_getStim | ( | ) | const |
get the stim series back
Definition at line 1061 of file StimMaker.C.
void StimMaker::SM_init | ( | const char | bgColor | ) |
re-init the frames to the background color
This should be called every time you want a completely new stim
Definition at line 94 of file StimMaker.C.
References Image< T >::resize(), and SM_setStandardBackGround().
Referenced by StimMaker().
void StimMaker::SM_makeUniformStim | ( | const StimMakerParam & | stim | ) |
create a new stim movie with the provided params
This will create a stimulus movie with one target and nxm-1 distractors. The shape and color of the target and distractors can be specified or they can be randomly chosen by the algorith. Additionally you can select whether to offset the blinking of stims or just start each one uniform at the start.
Definition at line 495 of file StimMaker.C.
References SM_drawGroundTruth(), SM_drawSingleTarget(), SM_speedDownCheck(), SM_speedUpCheck(), StimMakerParam::SMP_distColor, StimMakerParam::SMP_distOn, StimMakerParam::SMP_distOri, StimMakerParam::SMP_distPerCol, StimMakerParam::SMP_distPerRow, StimMakerParam::SMP_distRate, StimMakerParam::SMP_distShape, StimMakerParam::SMP_distSizeX, StimMakerParam::SMP_distSizeY, StimMakerParam::SMP_distState, StimMakerParam::SMP_randomSeed, StimMakerParam::SMP_shapeOrientationJitter, StimMakerParam::SMP_shapeOrientationJitterStatic, StimMakerParam::SMP_shapePositionJitter, StimMakerParam::SMP_shapePositionJitterStatic, StimMakerParam::SMP_targetColor, StimMakerParam::SMP_targetOn, StimMakerParam::SMP_targetOri, StimMakerParam::SMP_targetPosI, StimMakerParam::SMP_targetPosJ, StimMakerParam::SMP_targetRate, StimMakerParam::SMP_targetShape, StimMakerParam::SMP_targetSizeX, StimMakerParam::SMP_targetSizeY, StimMakerParam::SMP_targetState, StimMakerParam::SMP_useHexagon, StimMakerParam::SMP_useRandomStart, and StimMakerParam::SMP_useSmoothRateChange.
void StimMaker::SM_overRideRates | ( | const unsigned char | slowRate, | |
const unsigned char | fastRate, | |||
const unsigned char | stopRate | |||
) |
override the built in blink rates of stimuli
Definition at line 139 of file StimMaker.C.
void StimMaker::SM_setCustomColors | ( | const PixRGB< float > | BGcolor, | |
const PixRGB< float > | TargetColor, | |||
const PixRGB< float > | DistColor | |||
) |
overide the built in color sets for target and distractors
Definition at line 150 of file StimMaker.C.
void StimMaker::SM_setStandardBackGround | ( | const unsigned char | bgColor | ) |
reset the frames and back ground truth to the background color
Definition at line 130 of file StimMaker.C.
Referenced by SM_init().
ushort StimMaker::SM_speedDownCheck | ( | ushort | currBlinkRate, | |
const ushort | frame, | |||
const ushort | changeFrame, | |||
const unsigned char | stimRate, | |||
const unsigned char | useSmoothRateChange | |||
) | const [inline] |
check if we need to slow down the blink rate
Definition at line 194 of file StimMaker.C.
Referenced by SM_makeUniformStim().
ushort StimMaker::SM_speedUpCheck | ( | ushort | currBlinkRate, | |
const ushort | frame, | |||
const ushort | changeFrame, | |||
const unsigned char | stimRate, | |||
const unsigned char | useSmoothRateChange | |||
) | const [inline] |
check if we need to speed up the blink rate
Definition at line 161 of file StimMaker.C.
Referenced by SM_makeUniformStim().