"Error getting DataType" when creating StackedCube from Image array

Hi,

I’m trying to create a StackedCube object with the static Cube.FromImages Method using a Image-Array extracted from a Specim FX10e camera, however I get an ArgumentOutOfRange-Exception with the text “Error getting data type”.

The code is the following

//Find the camera
Device camera = null;
Image[] images = new Image[10];
DiscoveryInformationList deviceList = DeviceFactory.Discover();
camera = DeviceFactory.Open(deviceList[0]);
Stemmer.Cvb.Driver.Stream stream = camera.Stream;

//get 10 pictures
stream.Start();
for (int i = 0; i < 10; i++)
{
    Image img = stream.Wait();
    Image img2 = img.Copy();
    images[i] = img2 as Image;
}
stream.Stop();
StackedCube cube = Cube.FromImages(images, CubeEncoding.BandInterleavedByLine);

The Images have one plane and 8 bits per Pixel, any idea what am I missing?

Your code looks fine!

I guess that further below you are using the call cube.DataType() to access the data type of the cube.
Accessing the data type of the stacked cube gives an error in the dll version you are using. For other cube types this function is fine.
This behaviour has been fixed in this version here:
CVSpectral.zip (654.1 KB)