Error while processing NamesAndTypes v2.1 2013/12/17


#1

I’m getting a pipeline error when starting the image analysis ‘Error while processing NamesAndTypes’. It does not appear to affect the generation of measurements once I select 'Continue Processing…'
A screenshot of the error is attached



#2

Hi,

Are your images color? My guess is that you converted this pipeline from 2.0 and your images are grayscale. If true, then you need to manually change this setting “Select the image type” in NamesAndTypes to grayscale. When converting, there is a popup window that has these instructions, but I am afraid this may all-too-often be overlooked.

Let us know if this fixes it!
David


#3

Also, if David’s suggestion doesn’t work, it might be good to post the file itself. My guess from the message is that the file type might not be read correctly, which would be unfortunate :confused:
-Mark


#4

Sorry to get back to you so late, Ionnas. It looks like you were running from source maybe? The signature for one of the Java files changed - you should run “python external_dependencies.py -o” after a git pull in order to do a clean build of our Java code.


#6

I am having a similar issues running v2.1 on a windows 10 AWS instance. Everything seems to work if I hit continue processing, but when I load the properties file in CPA the classifier only loads a fraction of the example cells properly. My images are greyscale and that is appropriately selected in the names and type section.

Traceback (most recent call last):
File “cellprofiler\pipeline.pyc”, line 2094, in prepare_run
File “cellprofiler\modules\namesandtypes.pyc”, line 753, in prepare_run
File “cellprofiler\modules\namesandtypes.pyc”, line 1209, in create_imageset_dictionary
File “cellprofiler\measurements.pyc”, line 361, in setitem
File “cellprofiler\measurements.pyc”, line 805, in add_measurement
File “cellprofiler\utilities\hdf5_dict.pyc”, line 486, in setitem
File “cellprofiler\utilities\hdf5_dict.pyc”, line 577, in setitem
File “cellprofiler\utilities\hdf5_dict.pyc”, line 54, in new_setitem
File “h5py\highlevel.pyc”, line 1265, in setitem
File “h5py\selections.pyc”, line 94, in select
File “h5py\selections.pyc”, line 261, in getitem
File “h5py\selections.pyc”, line 512, in _handle_simple
File “h5py\selections.pyc”, line 553, in _translate_slice
ValueError: Zero-length selections are not allowed


#7

Have you examined the database to see if it seems like the data are being recorded correctly? That will help us figure out if the error is on CellProfiler’s side or CPA’s.

As David mentioned up-thread, errors of this kind can sometimes be generated if the pipeline was transferred across different versions of CellProfiler- do you know if that’s true in this case? If so, the first fix I’d try (even though it’s super frustrating) would be to rebuild the pipeline from scratch in whatever build of CP is on your instance and see if that gets rid of the problem. You can also try a re-pull of CP as Lee suggested.

If none of that works, you can upload your pipeline and a couple of sample images and I’ll see if I can replicate the issue in 2.1 on my Windows 10 PC


#8

The pipeline was transferred across versions so I rebuilt the pipeline and then I got a different exporttodatabase error that talked about something being referenced before assignment.

Then I tried to re-run it to get the exact details of the error and now I am getting this error:
"Encountered unrecoverable error in NamesAndTypes during startup:Zero-length selections are not allowed"
Traceback (most recent call last):
File “cellprofiler\pipeline.pyc”, line 2094, in prepare_run
File “cellprofiler\modules\namesandtypes.pyc”, line 753, in prepare_run
File “cellprofiler\modules\namesandtypes.pyc”, line 1209, in create_imageset_dictionary
File “cellprofiler\measurements.pyc”, line 361, in setitem
File “cellprofiler\measurements.pyc”, line 805, in add_measurement
File “cellprofiler\utilities\hdf5_dict.pyc”, line 486, in setitem
File “cellprofiler\utilities\hdf5_dict.pyc”, line 577, in setitem
File “cellprofiler\utilities\hdf5_dict.pyc”, line 54, in new_setitem
File “h5py\highlevel.pyc”, line 1265, in setitem
File “h5py\selections.pyc”, line 94, in select
File “h5py\selections.pyc”, line 261, in getitem
File “h5py\selections.pyc”, line 512, in _handle_simple
File “h5py\selections.pyc”, line 553, in _translate_slice
ValueError: Zero-length selections are not allowed

I probably just messed up something on the pipeline generation because I am quite a new user.

How do you recommend looking at the database?

I can pm you the pipeline, or I can also give you remote access to this instance if you’d like.


#9

You can either message me attach the pipeline here and 1-2 sample image sets here in a forum post, that’ll be fine.

Depending on if it’s a SQLite or MySQL database, you can either use something like SQLite browser or MySQL workbench- the latter does work on AWS MySQL databases too.


#10

How do you message someone privately? I would rather not have our pipeline up here for the world to see.


#11

Click on my avatar then click “message”


#12

I was afraid you’d say that. I don’t see it. Maybe I am too new to have that functionality?


#13

I’m not getting your NamesAndTypes error, so I can’t replicate that, but your pipeline runs fine in my hands. The NamesAndTypes error is something I’ve gotten in my own work in CP from time to time, and while it’s annoying as long as your data are running after I don’t think you should worry about it too much. AFAIK it was only an issue in 2.1, so if upgrading is an option you could always consider that.

I believe the CPA error may have been something to do with the fact you were writing all of your database information to a single object table- this is problematic when your different kinds of objects have different counts (in your pipeline for example, you have more Nuclei than Filtered Nuclei, Cells, and Cytoplasm)- see here for more discussion of the issue. You can solve it by editing your original working pipeline to use individual object tables or to only export measurements for the latter 3 object types.


#14

Great. Thanks. Will this be an issue for downstream CPA usage?


#15

It ran longer this time and I really thought it was going to work. However I got the following error, too: Error while processing ExportToDatabase:Worker UnboundLocalError: Local variable’row_stmt’ referenced before assignment.

Traceback (most recent call last):
File “cellprofiler\pipeline.pyc”, line 1934, in run_image_set
File “cellprofiler\modules\exporttodatabase.pyc”, line 1766, in run
File “cellprofiler\modules\exporttodatabase.pyc”, line 3166, in write_data_to_db
UnboundLocalError: local variable ‘row_stmt’ referenced before assignment