openworm / sibernetic

This is a C++/OpenCL implementation of the PCISPH algorithm supplemented with a set of biomechanics related features applied to C. elegans locomotion
Other
355 stars 106 forks source link

Steps towards integration of touch sensation #144

Open pgleeson opened 6 years ago

pgleeson commented 6 years ago
slarson commented 6 years ago

Hi @a-palyanov @skhayrulin -- now that the special issue is out; can we take a look at moving this forward? What do you guys think?

a-palyanov commented 6 years ago

I'm not a specialist in Python, but I can do the tasks which require modification of Sibernetic.

By the way, here is a paper "Determining the biomechanics of touch sensation in C. elegans" (2017), which might be useful in the context of this issue: https://www.researchgate.net/publication/320043028_Determining_the_biomechanics_of_touch_sensation_in_C_elegans

lungd commented 5 years ago

There is some progress on https://github.com/lungd/sibernetic/tree/touch_sensation I unintentionally used the dev branch of my repo as base, instead of the dev branch of Sibernetic. Have a look at https://github.com/lungd/sibernetic/compare/development...lungd:touch_sensation?expand=1, for commits related to touch sensation only.

Every time data gets written to the pressure file, there is a check whether the pressure to a particle, belonging to the body of the worm, has passed a HARDCODED threshold, set to 1.

Every particle of the worm is 'mapped' to the same HARDCODED section, set to the soma of AVM, which will receive input at the end. If the pressure to one of the particles has passed the threshold, Sibernetic calls a method for creating an input to the given section, unless an input has already been created due to another particle.

At the end, there is a method 'addStimulus' which creates a new input to an existing section with HARDCODED amplitude, set to 0.2.

loadPressureToFile():
    for p in shell_particles:
        if p.pressure > threshold 
            if not received:
                simulation.receivePressure(p.id, p.type, p.pressure)
                received = True

simulation.receivePressure(id, type, pressure):
    -> ... -> LEMS_FILE.addStimulus('a_AVM', p.pressure)

LEMS_FILE.addStimulus(self, sectionName, pressure):
    section = loadSection(sectionName)
    i = h.IClamp(section)
    i.delay = current_time
    i.dur = self.dt
    i.amp = 0.2

TODOs and thoughts:

Any feedback is welcome!

lungd commented 5 years ago

I applied some more changes:

Because the worm is straightened at the beginning of the simulation, I divided the worm into segments, based on the worm's length/width/height. I defined 5 sections: 3 body sections (each divided into 4 parts) + head + tail. The generated section file after running master_openworm.py: sectiontouch.txt

I removed the invocations for creating input to AVM for now.

Next, I will create a hardcoded map (sectionName -> neuronList)

If anyone is interested (@slarson), I created a container including my forks (c302, sibernetic; 'touch_sensation' branch) https://github.com/lungd/OpenWorm/tree/touch_sensation. I didn't create a PR for Sibernetic, because after creating new input for neurons, I will change c302_FW.py for testing purposes.

lungd commented 5 years ago

Is pressure alone sufficient for detecting touch? I think we need to check surrounding particles as well, otherwise, we cannot distinguish between pressure coming from the environment, and pressure coming from a body bend? What do you guys think (@skhayrulin @a-palyanov @pgleeson)?

ido4848 commented 3 years ago

What's the status of this?