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

scaling of cell positions #202

Closed
jasmainak opened this issue Nov 6, 2020 · 7 comments · Fixed by #314
Closed

scaling of cell positions #202

jasmainak opened this issue Nov 6, 2020 · 7 comments · Fixed by #314
Labels
bug Something isn't working question Further information is requested

Comments

@jasmainak
Copy link
Collaborator

I discovered in #200 that the cell positions are scaled in a somewhat odd way:

self.translate_to(self.pos[0] * 100, self.pos[2], self.pos[1] * 100)

This seems like a bug to me but maybe we are missing something. Two questions:

  • why is self.pos[2] passed instead of self.pos[1] for y coordinate
  • why is self.pos[2] not scaled by 100?

It's not super-clear where this factor 100 comes from. Since the dipole moment = current * distance, this will affect the final result. cc @stephanie-r-jones @rythorpe

@jasmainak jasmainak added bug Something isn't working question Further information is requested labels Nov 6, 2020
@rythorpe
Copy link
Contributor

@jasmainak I just realized that in nrn-space, the apical dendrite extends along the y-axis and contributes to the net dipole along with all other dendrites with a y-components. Note that the soma and apical dendrite are modeled as cylinders who's aligned axes extends along the 2nd dimension.

@jasmainak
Copy link
Collaborator Author

not sure I follow. yscale (ideally should be cos theta) is hard coded and the scale is applied here. The actual orientation (angle) of the dendrite is not used anywhere ...

@rythorpe
Copy link
Contributor

not sure I follow. yscale (ideally should be cos theta) is hard coded and the scale is applied here. The actual orientation (angle) of the dendrite is not used anywhere ...

The points that define the extent of the cylindrical soma and apical dendrites create an axis along the 2nd dimension. Unless these compartments get rotated somewhere in the code that I'm unaware of, this convention is maintained by translating the 2nd (y) dimension of the nrn model by self.pos[2] (what we visualize as the z-dimension in the high-level python model).

I think you're right that it doesn't explicitly calculate the y-component, however, across the population, the net contribution of other components should be negligible. (I don't completely understand what is going on h.Dipole.)

@cjayb
Copy link
Collaborator

cjayb commented Apr 27, 2021

My head's spinning with the orientations here. Can we agree on what the three cardinal axes are? It seems like y is used as the axis parallel to the apical dendrite orientation. Do you agree?

@rythorpe
Copy link
Contributor

My head's spinning with the orientations here. Can we agree on what the three cardinal axes are? It seems like y is used as the axis parallel to the apical dendrite orientation. Do you agree?

Correct, that is my understanding. Personally, I think we should change this in the model so that 'z' || apical dendrite orientation.

@cjayb
Copy link
Collaborator

cjayb commented Apr 29, 2021

I think so too, though I'd like to understand the original reason for choosing the axis order. Is there a NEURON convention this is following? Or is it simply that HNN was conceived as a 2D (xz-)model, so it made sense to align the dipole moment with the second?

@samnemo perhaps you can shed light here too?

@jasmainak
Copy link
Collaborator Author

jasmainak commented Apr 29, 2021

see here:

# Define 3D shape and position of cell. By default neuron uses xy plane
# for height and xz plane for depth. This is opposite for model as a
# whole, but convention is followed in this function ease use of gui.

this may (or may not) answer some questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants