Fast conversion from matlab image format (based on leo's structure) to a YARP image format
in MATLAB, the reshape function to modify the matrix to be a 1d vector IN = reshape(label, [h*w*pixelSize 1]);
and, if not previously done cast it to int16 eg: tempImg = cast(IN,'int16');
\author Vadim Tikhanoff