Skip to content

Adding thumbnail generating function #19

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

Closed
wants to merge 3 commits into from
Closed

Conversation

darshanmandge
Copy link
Collaborator

No description provided.

@darshanmandge darshanmandge self-assigned this Jun 2, 2025
@darshanmandge darshanmandge requested review from AurelienJaquier and ilkilic and removed request for AurelienJaquier June 23, 2025 13:57
@darshanmandge darshanmandge marked this pull request as ready for review June 23, 2025 13:57
# we use calculate_rheobase() to find the threshold_current.
# For this case, we set the holding_current to 0.0 nA.
# if threshold_current is None:
threshold_current = 1.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you overwriting this value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The threshold current calculation should be done every time as the morphology of the me-combination will change and it won't be emodel threshold to be sure we are not using the emodel threshold. The value was overwritten just to initialise of the cell.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be called after we compute the threshold, and we just get it from MEModelCalibration. So we can remove the threshold computation

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I will not overwrite the threshold and holding currents. I will pass the emodel_properties instead.

template_format=template_format,
emodel_properties=emodel_properties,
)
holding_current = 0.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here also, you are overwriting holding current and computing rheobase even if we have passed those values to the function

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same but for holding current.

section="soma[0]",
segx=0.5
)
print(f"Threshold current: {newthreshold_current}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use logger.info instead of print

)

# Create cell
thumbnail_cell = Cell(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need to re-create the cell

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't recreate the cell, the thumbnail generation step protocol would persist even after the thumbnail was generated. I also delete the cell at the end.

emodel_properties=emodel_properties,
)

# Add 130% threshold current injection
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment is not consistent with code

sim.add_cell(thumbnail_cell)

neuron_globals = NeuronGlobals.get_instance()
# neuron_globals.temperature = celsius
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are those commented out?



def generate_cell_thumbnail(
template_path: str,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you reduce the number of function arguments by passing template_params instead?
See https://github.com/openbraininstitute/BlueCelluLab/blob/main/bluecellulab/cell/template.py#L48

@darshanmandge
Copy link
Collaborator Author

Closing in favour of #27

@darshanmandge darshanmandge deleted the thumbnail_function branch June 23, 2025 15:13
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

Successfully merging this pull request may close these issues.

2 participants