ChristophKirst / ClearMap

ClearMap is a python toolbox for the analysis and registration of volumetric data from cleared tissues.
http://christophkirst.github.io/ClearMap/build/html/index.html
GNU General Public License v3.0
49 stars 40 forks source link

Table generation. Annotation files only have a single entry. #13

Closed vzickus closed 6 years ago

vzickus commented 6 years ago

I think I am having issues caused by this bit of code in the process_template.py script.


#Table generation:
##################
#With integrated weigths from the intensity file (here raw intensity):
ids, counts = countPointsInRegions(points, labeledImage = AnnotationFile, intensities = intensities, intensityRow = 0);
table = numpy.zeros(ids.shape, dtype=[('id','int64'),('counts','f8'),('name', 'a256')])
table["id"] = ids;
table["counts"] = counts;
table["name"] = labelToName(ids);
io.writeTable(os.path.join(BaseDirectory, 'Annotated_counts_intensities.csv'), table);

#Without weigths (pure cell number):
ids, counts = countPointsInRegions(points, labeledImage = AnnotationFile, intensities = None);
table = numpy.zeros(ids.shape, dtype=[('id','int64'),('counts','f8'),('name', 'a256')])
table["id"] = ids;
table["counts"] = counts;
table["name"] = labelToName(ids);
io.writeTable(os.path.join(BaseDirectory, 'Annotated_counts.csv'), table);

The first red flag is that the terminal outputs "Processed 0/6059", but never increases and the script ends without any error. However, the output of "Annotated_counts.csv" and "Annotated_counts_intensities.csv" only contain one row with three columns. I ran the "Check Cell detection" bit of the code, and can clearly see a lot more cells detected. Any ideas what could be the cause of this? I initially ran into issue #6, but after hard-coding the correct path, I am still getting only a single row input in the aforementioned files.

vzickus commented 6 years ago

Following the filenames in the tutorial and the accompanying resource file, I had used the wrong annotation file.

sronilsson commented 5 years ago

vzickus - I'm running into the same issues: this and #6. Im using the annotation_25_full_color.tif that came with the download from OSF website. Which is the correct annotation file? ta!

vzickus commented 5 years ago

This has been quite some time ago, and now I cannot remember (for the benefit of others, that last comment should have been more descriptive to be honest). If I don't forget, I will try to have a look tomorrow.

sronilsson commented 5 years ago

Alright, thanks!

vzickus commented 5 years ago

OK, so in my parameter_file scripts I have:

AtlasFile = os.path.join(PathReg, '2p_mouse_brain_data_25um.tif'); AnnotationFile = os.path.join(PathReg, 'annotation_25_full.nrrd');

Where PathReg is just </path/to/atlas/files>

So .nrrd must be the correct annotation file to use. Can you try and let me know if this works?

sronilsson commented 5 years ago

Seemed to have worked - thanks, much appreciated