Trouble importing chopped images (X and Z)


I’m working with an older dataset which was chopped in the X and Z planes. When trying to merge the images I keep getting this error:

Expected one output from a curly brace or dot indexing expression, but there were 0 results.

Error in mibRechopDatasetController/combineBtn_Callback (line 189)
stacks = stacks + files{id}.noLayers;

Error in mibRechopDatasetGUI>combineBtn_Callback (line 132)

Error in gui_mainfcn (line 95)

Error in mibRechopDatasetGUI (line 50)
gui_mainfcn(gui_State, varargin{:});

Error in>@(hObject,eventdata)mibRechopDatasetGUI(‘combineBtn_Callback’,hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.

I am just using the user interface and haven’t written any code, so I’m curious about the “missing a curly bracket or dot” part of the error. I have made sure the voxel sizes match all images. This error happens when trying to merge images in both X, Z, and combined directions, with or without the models attached.

Any ideas?

Hi @buenoc,
I am sorry it did not work, I probably need more info to fix that…

I just tested chopping a dataset to x2 X and x1 Y and x2 Z. My destination formats were *.AM and *.model. After that I was able to rechop the datasets back (via Generate new stack) for both images only and images with models. In later case, there was an error, which was coming after stitching and does not affect results.

If you are on the matlab version of MIB you can add
notify(obj.mibModel, 'newDataset');
after line 237 (obj.mibModel.I{obj.mibModel.Id}.updateBoundingBox(bb);) in mibRechopDatasetController.m.

Here is the section of the code after which this line should be added:

% update the bounding box
bb = obj.mibModel.I{obj.mibModel.Id}.getBoundingBox();
bb(2) = bb(1) + (width-1)*pixSize{1}.x;
bb(4) = bb(3) + (height-1)*pixSize{1}.y;
bb(6) = bb(5) + (stacks-1)*pixSize{1}.z;

Returning back to your problem, could you remember these:

  1. have you assembled original stack from 2D TIF files?
  2. what was the saving format during the chopping? AM, TIF, HDF5?
  3. have you tried to re-chop only the models? Open original stack and select only the Model option in the Combine the following panel of Chopped images->Import->Generate new stack;


Hi Ilya,

I wasn’t the one to originally compile or chop the dataset so I’m not entirely sure, but we generally use Amira to compile stacks from 2D PNG images and save this out as an .am file.

I ended up going back to the raw data and generating the images in this way and chopping it myself, and these were fine to merge back together. In order to get the models to merge, I converted them to .models (they were saved as compressed amira files) and found that four of them had that reshape error that I talked about in my last post. I wonder if there was an issue with these files which was preventing merging?

Once I converted the labels to .models I was able to merge just the models over the image dataset that I had compiled.


was there any specific need to convert models from AM to .model? You should be able to combine compressed AM files, so there is no real need of converting them to *.model (there is an option Format of models, where you can select AM).
If you want we can set a meeting to check that.

When I tried to combine the compressed Amira files I got a “reshape” error which is why I decided to convert them to .model. It seems that four of the 20 labels had the “reshape” error when opened individually. I ‘fixed’ it by opening and re-saving the files in Amira, and then converted them as well into .models.