Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Adding specific annotation (metadata tags) to mass imports of swcs to Catmaid #249

Open
Mohinta2892 opened this issue Jan 16, 2025 · 3 comments

Comments

@Mohinta2892
Copy link

Hi!

To upload selected skels into a CATMAID instance, I am currently running the below:

resp = pymaid.upload_neuron(n, source_type=None, remote_instance=rm)

Once imported, it saves Import as the annotated as metadata tag.
I wish to modify this tag per the class name of my selected skels, for example, segmented-KCs.

Do I need to modify the TreeNeuron object to have this as a value to any attribute?

Best,
Samia

@clbarnes
Copy link
Collaborator

clbarnes commented Jan 16, 2025

Yes, to annotate an uploaded CatmaidNeuron you can modify its annotations list, and then set import_annotations=True in upload_neuron.

@Mohinta2892
Copy link
Author

Mohinta2892 commented Jan 17, 2025

Thanks Chris.

n = TreeNeuron

In it's attributes this is all I see:

{'nodes': <class 'pandas.core.frame.DataFrame'>, 'graph': 'nx.DiGraph', 'igraph': 'igraph.Graph', 'n_branches': <class 'int'>, 'n_leafs': <class 'int'>, 'cable_length': typing.Union[int, float], 'segments': typing.List[list], 'small_segments': typing.List[list], 'root': <class 'numpy.ndarray'>, 'soma': typing.Union[int, str, NoneType], 'soma_pos': typing.Union[typing.Sequence, NoneType], 'soma_detection_radius': typing.Union[float, int, pint.util.Quantity], 'soma_detection_label': typing.Union[float, int, str], 'soma_radius': typing.Union[float, int, str], '_soma': typing.Union[typing.Callable[[ForwardRef('TreeNeuron')], typing.Sequence[int]], int], 'tags': typing.Union[typing.Dict[str, typing.List[int]], NoneType]}

Do I then need to wrap it back to be a Catmaid neuron and then edit the annotations list?
Also, because we are uploading, this neuron does not contain any annotations. Need to assign it so that it uploads with that annotation, rather than a generic Import.

@clbarnes
Copy link
Collaborator

Yes, looks like TreeNeurons don't have any annotations, but IIRC you can just do CatmaidNeuron(my_tree_neuron) and it should all work, then update the annotations on the new object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants