BlueBrain / NeuroM

Neuronal Morphology Analysis Tool
https://neurom.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
101 stars 55 forks source link

Change definition of "number_of_sections" of populations in get (of both ezy and fst modules) #364

Closed lidakanari closed 8 years ago

lidakanari commented 8 years ago

The "number_of_sections" should return a list of the total number of sections per neuron. Currently it adds up all the sections of the population. Here is an example:

from neurom import fst
pop = fst.load_population('./test_data/valid_set/')
fst.get('number_of_sections', pop)

Out: array([336])

The number of neurons in the population is 5:

len(pop.neurons)
Out: 5

So the correct result would be:

Out: array([42],  [42],  [84],  [84], [84])
juanchopanza commented 8 years ago

That probably makes more sense. Whatever it does, it should be documented clearly. i.e. the behaviour here would be different for populations and single neurons. So we'd need to document what it does in either case.

juanchopanza commented 8 years ago

Maybe it would be better to specify clearly what each of the "feature" functions should return, both for single neurons and for populations.

lidakanari commented 8 years ago

Yes, sorry.. I though it was common sense!

The feature of "number_of_sections" should return:

The same goes for the "total_length" or other total measurements.

Is this a little bit more clear?

juanchopanza commented 8 years ago

@lidakanari That is fine, thanks. @eleftherioszisis I think you implemented the "feture getters", right? If so, did you have a reason to implement the current functionality, or is it OK to change it?

lidakanari commented 8 years ago

@eleftherioszisis Also, I am not sure if it should be a list or a np.array (please confirm so that we make all the features consistent )!

eleftherioszisis commented 8 years ago

@juanchopanza Yes, indeed I implemented them. I didn't have any particular reasons for the total numbers due to not knowing what was needed. I believe that the per neuron numbers are much more useful for analysis, and in fact I needed per neuron total numbers as well for astrocytes, which I calculated manually. :P

All the features I implemented in the features module returned iterators that were converted into numpy arrays. Keep also in mind that if a single value is returned instead of an array of one value, then respective checks must be added in automated analyses of features.

juanchopanza commented 8 years ago

OK, thanks for the information. I can start working on this next week.

juanchopanza commented 8 years ago

BTW, shouldn't the output be

array([42,  42,  84,  84, 84])

I can't see a reason for the inner arrays.

lidakanari commented 8 years ago

Yes, you are right :) That's what I got from my quick (and dirty) implementation, so your proposal is the correct one.

juanchopanza commented 8 years ago

fst was taken care of in #368. Someone else can do neuron.features if required.