Loading Pipelines within Developer


#1

Hi!

I am just started to explore the source code within the Developers Version.

To do so, I loaded CellProfiler.m into MatLab and started it by pressing F5 (run).

Next, I created a little pipeline, just composed of one module and saved it.

However, when I try to reload the pipeline, using: File -> Load Pipeline, it does not work: the Modules window just says: “Loading…”

MatLab says:

**??? Error using ==> waitbar at 249
Improper arguments for waitbar

Error in ==> CPwaitbar at 9
fout = waitbar(varargin{:});

Error in ==> CellProfiler>LoadPipeline_Callback at 1000
CPwaitbar(i/length(handles.Settings.ModuleNames),WaitBarHandle,‘Loading Pipeline…’);

Error in ==> CellProfiler>gui_mainfcn at 6073
feval(varargin{:});

Error in ==> CellProfiler at 55
gui_mainfcn(gui_State, varargin{:});

??? Error while evaluating uimenu Callback
**

Any idea what I am doing wrong here?

Thanks!
Christian.


Tracking Objects
#2

Hi,

I’m not sure what would be responsible for that error, but I do have a couple of questions that might help diagnose the problem:
(a) What version of MATLAB are you running? You can find out by typing ‘ver’ at the MATLAB command prompt.

(b) What is the revision number of CellProfiler.m? You can find that out by looking at the very top of the .m file and looking for a line that says ‘$Revision:’. The revision is the number next to it.
-Mark


#3

MATLAB Version 7.7.0.471 (R2008b)
MATLAB License Number: 566334
Operating System: Microsoft Windows XP x64 Version 5.2 (Build 3790: Service Pack 2)
Java VM Version: Java 1.6.0_04 with Sun Microsystems Inc. Java HotSpot™ 64-Bit Server VM mixed mode

% Revision: 5931

does this help?


#4

in addition, i was wondering, maybe i have to set some PATHS somewhere?

i do not(!) have the CP source code in one of the Matlab sub-folders, maybe this is the problem?!


#5

Hi,

It’s a possibility that your paths might need setting, but CP should do that for you (in lines 33 and following).

But in any case, if you check your MATLAB path (in the MATLAB command window, File >> Set Path…), you need to have at least the following subdirectories listed for CP to work (in addition to the CP root directory itself): Modules, Help, DataTools, CPsubfunctions, and ImageTools. If not, add them and save the path.

It doesn’t look like it’s a path issue, though, since it’s finding CPwaitbar (which is in the CPsubfunctions directory).

Take a look at your preferences (File >> Set Preferences), especially the folder where your modules are stored. If it’s not pointing in the proper location, set it properly and save the preferences
-Mark


#6

…well, I think it is pointing to the right directory; at least it correctly finds all the modules, i.e. I can add modules.

the thing is: I can create a pipeline, save it, use it, analyse images with it.

basically, everything works nicely, BUT loading a pipeline that I saved…


#7

MATLABPATH

C:\Program Files\CellProfiler\SourceCellProfiler\CellProfiler_5811Bugfix\Modules
C:\Program Files\CellProfiler\SourceCellProfiler\CellProfiler_5811Bugfix\Help
C:\Program Files\CellProfiler\SourceCellProfiler\CellProfiler_5811Bugfix\DataTools
C:\Program Files\CellProfiler\SourceCellProfiler\CellProfiler_5811Bugfix\ImageTools
C:\Documents and Settings\Christian Tischer\My Documents\MATLAB
C:\Program Files\CellProfiler\SourceCellProfiler\CellProfiler_5811Bugfix
C:\Program Files\CellProfiler\SourceCellProfiler\CellProfiler_5811Bugfix\BatchProfiler
C:\Program Files\CellProfiler\SourceCellProfiler\CellProfiler_5811Bugfix\CPsubfunctions
C:\Program Files\CellProfiler\SourceCellProfiler\CellProfiler_5811Bugfix\CPsubfunctions\graphAnalysisToolbox-1.0
C:\Program Files\CellProfiler\SourceCellProfiler\CellProfiler_5811Bugfix\CPsubfunctions\graphAnalysisToolbox-1.0\DOCS
C:\Program Files\CellProfiler\SourceCellProfiler\CellProfiler_5811Bugfix\CPsubfunctions\ljosaprobseg-1.0
C:\Program Files\CellProfiler\SourceCellProfiler\CellProfiler_5811Bugfix\CPsubfunctions\ljosaprobseg-1.0\vlcutils
C:\Program Files\CellProfiler\SourceCellProfiler\CellProfiler_5811Bugfix\DeveloperScripts
C:\Program Files\CellProfiler\SourceCellProfiler\CellProfiler_5811Bugfix\DeveloperScripts\WormIdentification
C:\Program Files\CellProfiler\SourceCellProfiler\CellProfiler_5811Bugfix\ImagesForManual
C:\Program Files\CellProfiler\SourceCellProfiler\CellProfiler_5811Bugfix\ImagesForManual\CPCoverPageSourceFiles
C:\Program Files\CellProfiler\SourceCellProfiler\CellProfiler_5811Bugfix\ImagesForManual\CPCoverPageSourceFiles\Figure
C:\Program Files\CellProfiler\SourceCellProfiler\CellProfiler_5811Bugfix\contrib
C:\Program Files\CellProfiler\SourceCellProfiler\CellProfiler_5811Bugfix\contrib\Modules

#8

Hi,

OK, I took a closer look and it seems that the handling of the waitbar has changed with MATLAB R2008b. Since you’re using the Developer’s version, you’ll be able to fix it.

In the M-file CPwaitbar in the CPsubfunctions directory, change the following:
At line 9:

[quote]fout = waitbar(varargin{:});
userData.Application = ‘CellProfiler’;
userData.ImageFlag = 0;
set(fout, ‘Color’, [0.7 0.7 0.9], ‘UserData’,userData);[/quote]

Change to

[quote]v = ver(‘matlab’);
is2008b = strcmp(v.Version,‘7.7’);
if is2008b && nargin > 2, % Updating previously created waitbar
fin = varargin{2};
userData = get(fin,‘userdata’);
set(fin,‘userdata’,userData.FractionInput);
end
fout = waitbar(varargin{:});
userData.Application = ‘CellProfiler’;
userData.ImageFlag = 0;
if is2008b, userData.FractionInput = get(fout,‘userdata’); end[/quote]


#9

Hi Mark,

I made the replacement but I still get an error:

**??? Attempt to reference field of non-structure array.

Error in ==> CPwaitbar at 15
set(fin,‘userdata’,userData.FractionInput);

Error in ==> CellProfiler>LoadPipeline_Callback at 1000
CPwaitbar(i/length(handles.Settings.ModuleNames),WaitBarHandle,‘Loading Pipeline…’);

Error in ==> CellProfiler>gui_mainfcn at 6073
feval(varargin{:});

Error in ==> CellProfiler at 55
gui_mainfcn(gui_State, varargin{:});

??? Error while evaluating uimenu Callback
**

any ideas?

Christian.


#10

…i had a closer look and it seems that the “userdata” field contains no entries.

fin = varargin{2};
get(fin)

yields as output:

Alphamap =  (1 by 64) double array]
CloseRequestFcn = closereq
Color = [0.8 0.8 0.8]
Colormap = ]
CurrentAxes = [1.01587]
CurrentCharacter = 
CurrentObject = ]
CurrentPoint = [0 0]
DockControls = off
FileName = 
FixedColors =  (11 by 3) double array]
IntegerHandle = off
InvertHardcopy = on
KeyPressFcn = 
KeyReleaseFcn = 
MenuBar = none
MinColormap = [64]
Name = 
NextPlot = add
NumberTitle = off
PaperUnits = inches
PaperOrientation = portrait
PaperPosition = [0.25 2.5 8 6]
PaperPositionMode = manual
PaperSize = [8.5 11]
PaperType = usletter
Pointer = arrow
PointerShapeCData =  (16 by 16) double array]
PointerShapeHotSpot = [1 1]
Position = [585 422.25 270 56.25]
Renderer = painters
RendererMode = auto
Resize = off
ResizeFcn = 
SelectionType = normal
ToolBar = auto
Units = points
WindowButtonDownFcn = 
WindowButtonMotionFcn = 
WindowButtonUpFcn = 
WindowKeyPressFcn = 
WindowKeyReleaseFcn = 
WindowScrollWheelFcn = 
WindowStyle = normal
WVisual = 00 (RGB 32  GDI, Bitmap, Window)
WVisualMode = auto

BeingDeleted = off
ButtonDownFcn = 
Children = [1.01587]
Clipping = on
CreateFcn = 
DeleteFcn = 
BusyAction = queue
HandleVisibility = callback
HitTest = on
Interruptible = off
Parent = [0]
Selected = off
SelectionHighlight = on
Tag = TMWWaitbar
Type = figure
UIContextMenu = ]
**UserData = [0]**
Visible = on

#11

My mistake. I should have said:
Change to

[quote]v = ver(‘matlab’);
is2008b = strcmp(v.Version,‘7.7’);
if is2008b && nargin > 2, % Updating previously created waitbar
fin = varargin{2};
userData = get(fin,‘userdata’);
set(fin,‘userdata’,userData.FractionInput);
end
fout = waitbar(varargin{:});
userData.Application = ‘CellProfiler’;
userData.ImageFlag = 0;
if is2008b, userData.FractionInput = get(fout,‘userdata’); end
set(fout, ‘Color’, [0.7 0.7 0.9], ‘UserData’,userData);
[/quote]


#12

Hi Mark,

it indeed seems to work now!

thank you very much!

:smiley: :smiley: :smiley:

Christian.

PS: I don’t really understand why it works now…if you have too much time I would be interested in a little explanantion, but in case you are busy: don’t worry. :wink:


#13

HI Christian,

The explanation is pretty straightforward: MATLAB changed how it stored the waitbar info between R2008a and R2008b. This caused it to break when you tried to load a pipeline and it shows the progress in the waitbar. We still primarily use R2008a here, so thanks for bringing it to our attention.
-Mark


#14

Wow! This was definitely a life saver. I’m really glad I saw this as it definitely helped out a lot. Couldn’t understand why it wasn’t working. Thanks to both of you all for going through this before I got to it :smile:. Perhaps this could be a sticky as more people move over to R2008b (depending on when the next release of CP’s going to be. Cheers again! BTW. are any of you guys at ASCB?

-Peter


#15

Hi Peter,

That’s a good idea; we’ll make an announcement or a sticky note re: R2008b fix soon. And unfortunately, no, none of us are going to be at the ASCB this year.

Regards,
-Mark