ClearAnatomics / ClearMap

ClearMap 2 with WobblyStitcher, TubeMap and CellMap
https://clearanatomics.github.io/ClearMapDocumentation/
GNU General Public License v3.0
114 stars 45 forks source link

Export ID numbers for ClearMap2.1? #124

Open cardinger opened 1 year ago

cardinger commented 1 year ago

Hello,

Is there any easy way to export a full list of all of the possible ClearMap2.1 ID numbers? Basically looking for an excel file of the tools > structure selector screen. Is this available?

Thanks!

crousseau commented 1 year ago

How about this ?

"""This assumes you are using the latest version (not default) of the atlas.
This is strongly advised but is not the default in the current version to keep the same behaviour as 2.0."""

import os

import ClearMap.Alignment.Annotation as annotation
import ClearMap.Settings as settings

annotation_file_path = os.path.join(settings.atlas_folder, 'ABA_25um_2017_annotation.tif')
label_file_path = os.path.join(settings.atlas_folder, 'ABA_annotation_last.json') 
annotation.initialize(annotation_file=annotation_file_path, label_file=label_file_path)

desination_file_path = os.path.expanduser('~/labels.csv')  # Replace destination here to your liking
annotation.annotation.df.to_csv(desination_file_path)