version 1.47 | version 1.48 |
---|
| |
## VND -- Visual Neuronal Dynamics I/O, parsing, selection, and data storage | ## VND -- Visual Neuronal Dynamics I/O, parsing, selection, and data storage |
## | ## |
## $Id: vnd_read.tcl,v 1.47 2025/04/28 21:30:41 barryi Exp $ | ## $Id: vnd_read.tcl,v 1.48 2025/06/30 23:56:37 barryi Exp $ |
## | ## |
## | ## |
## Home Page | ## Home Page |
| |
} | } |
| |
| |
proc ::neuro::proto_show_morph_moved_soma_only {node_type fileset_num x y z xrot yrot zrot soma_radius_scale} { | proc ::neuro::proto_show_morph_moved_soma_only {node_type fileset_num x y z xrot yrot zrot soma_radius_scale soma_resolution} { |
#variable morphoHash | #variable morphoHash |
variable typeHash | variable typeHash |
| |
| |
set draw_radius_scale $soma_radius_scale | set draw_radius_scale $soma_radius_scale |
#draw spheretube "{ $x $y $z }" radii "{ $soma_radius_scale }" drawtubes 0 | #draw spheretube "{ $x $y $z }" radii "{ $soma_radius_scale }" drawtubes 0 |
# spheretube seems not being recognized by MoleculeGraphics::find_bounds check | # spheretube seems not being recognized by MoleculeGraphics::find_bounds check |
draw sphere [list $x $y $z] radius $soma_radius_scale | draw sphere [list $x $y $z] radius $soma_radius_scale resolution $soma_resolution |
#draw spheretube "$sphereList" radii $radiusList drawtubes 1 | #draw spheretube "$sphereList" radii $radiusList drawtubes 1 |
} | } |
| |
| |
} | } |
draw material $material | draw material $material |
switch $style { | switch $style { |
soma { proto_show_morph_moved_soma_only $etype $efileset_num $ex $ey $ez $exrot $eyrot $ezrot $rad_scale} | soma { proto_show_morph_moved_soma_only $etype $efileset_num $ex $ey $ez $exrot $eyrot $ezrot $rad_scale $sph_resolution} |
morphology_line {proto_show_morph_moved_line $etype $efileset_num $ex $ey $ez $exrot $eyrot $ezrot $rad_scale} | morphology_line {proto_show_morph_moved_line $etype $efileset_num $ex $ey $ez $exrot $eyrot $ezrot $rad_scale} |
morphology_draft {proto_show_morph_moved $etype $efileset_num $ex $ey $ez $exrot $eyrot $ezrot $rad_scale} | morphology_draft {proto_show_morph_moved $etype $efileset_num $ex $ey $ez $exrot $eyrot $ezrot $rad_scale} |
morphology {proto_show_morph_moved_spheretube $etype $efileset_num $ex $ey $ez $exrot $eyrot $ezrot $rad_scale} | morphology {proto_show_morph_moved_spheretube $etype $efileset_num $ex $ey $ez $exrot $eyrot $ezrot $rad_scale} |
| |
} | } |
# now adjust for color-based width changes by changing rad_scale | # now adjust for color-based width changes by changing rad_scale |
set rad_scale [expr $theScaling * $default_rad_scale * ($width_scale_min + (($c +1)/32.0)*$width_scale_max_min)] | set rad_scale [expr $theScaling * $default_rad_scale * ($width_scale_min + (($c +1)/32.0)*$width_scale_max_min)] |
puts "c= $c rad_scale= $rad_scale" | #puts "c= $c rad_scale= $rad_scale" |
#draw sphere [list [expr 10 * $ex] [expr 10 * $ey] [expr 10 * $ez]] radius $node_radius resolution 12 | #draw sphere [list [expr 10 * $ex] [expr 10 * $ey] [expr 10 * $ez]] radius $node_radius resolution 12 |
##draw sphere [list [expr $ex] [expr $ey] [expr $ez]] radius $node_radius resolution 4 | ##draw sphere [list [expr $ex] [expr $ey] [expr $ez]] radius $node_radius resolution 4 |
#show_morph_moved $etype $ex $ey $ez 0 $eyrot 0 3 | #show_morph_moved $etype $ex $ey $ez 0 $eyrot 0 3 |
| |
#draw spheretube "$sphereList" radius $soma_radius drawtubes 0 | #draw spheretube "$sphereList" radius $soma_radius drawtubes 0 |
} | } |
| |
proc ::neuro::proto_show_nodes_from_list_soma_only {subsetNodeIdList colorMethod theScaling} { | proc ::neuro::proto_show_nodes_from_list_soma_only {subsetNodeIdList colorMethod theScaling theResolution} { |
# Display the nodes as soma spheres only | # Display the nodes as soma spheres only |
# colorMethod is "Type" or an integer. | # colorMethod is "Type" or an integer. |
# ... which colors by type if "Type", is constant assigned color if integer. | # ... which colors by type if "Type", is constant assigned color if integer. |
| |
#draw sphere [list [expr 10 * $ex] [expr 10 * $ey] [expr 10 * $ez]] radius $node_radius resolution 12 | #draw sphere [list [expr 10 * $ex] [expr 10 * $ey] [expr 10 * $ez]] radius $node_radius resolution 12 |
##draw sphere [list [expr $ex] [expr $ey] [expr $ez]] radius $node_radius resolution 4 | ##draw sphere [list [expr $ex] [expr $ey] [expr $ez]] radius $node_radius resolution 4 |
#show_morph_moved $etype $ex $ey $ez 0 $eyrot 0 3 | #show_morph_moved $etype $ex $ey $ez 0 $eyrot 0 3 |
proto_show_morph_moved_soma_only $etype $efileset_num $ex $ey $ez $exrot $eyrot $ezrot [expr 3*$theScaling] | proto_show_morph_moved_soma_only $etype $efileset_num $ex $ey $ez $exrot $eyrot $ezrot [expr 3*$theScaling] $theResolution |
incr n | incr n |
# end of virtual / cartesian check | # end of virtual / cartesian check |
incr ::NeuronVND::statusPbarVal; # update gui progressbar | incr ::NeuronVND::statusPbarVal; # update gui progressbar |
| |
} | } |
node { | node { |
set itemList [lrange $e 2 end] | set itemList [lrange $e 2 end] |
puts "in node_id, itemList= >$itemList<" | #puts "in node_id, itemList= >$itemList<" |
set outputList [node_id_select_list $e1 $itemList $theList] | set outputList [node_id_select_list $e1 $itemList $theList] |
} | } |
node_id { | node_id { |
set itemList [lrange $e 2 end] | set itemList [lrange $e 2 end] |
puts "in node_id, itemList= >$itemList<" | #puts "in node_id, itemList= >$itemList<" |
set outputList [node_id_select_list $e1 $itemList $theList] | set outputList [node_id_select_list $e1 $itemList $theList] |
} | } |
| gid { |
| set itemList [lrange $e 2 end] |
| #puts "in global_node_id, itemList= >$itemList<" |
| set outputList [global_node_id_select_list $e1 $itemList $theList] |
| } |
global_node_id { | global_node_id { |
set itemList [lrange $e 2 end] | set itemList [lrange $e 2 end] |
puts "in global_node_id, itemList= >$itemList<" | #puts "in global_node_id, itemList= >$itemList<" |
set outputList [global_node_id_select_list $e1 $itemList $theList] | set outputList [global_node_id_select_list $e1 $itemList $theList] |
} | } |
fileset { | fileset { |
| |
# | # |
set molec [mol new] | set molec [mol new] |
set shown true | set shown true |
| graphics $molec material $material |
# here, draw needed neurons | # here, draw needed neurons |
# make selection | # make selection |
| |
| |
set displayed_virtuals_at_creation $display_virtuals_at_creation | set displayed_virtuals_at_creation $display_virtuals_at_creation |
lappend nrepList [list $newNrepid $shown $molec $style $colorMethod $material $full_selection_string $stride $num_neurons $displayed_virtuals_at_creation $scaling $resolution] | lappend nrepList [list $newNrepid $shown $molec $style $colorMethod $material $full_selection_string $stride $num_neurons $displayed_virtuals_at_creation $scaling $resolution] |
incr nrepCount | incr nrepCount |
| #set defaultScaling 1.0 |
set defaultScaling 1.0 | set defaultScaling $scaling |
#use $scaling instead? | |
switch $style { | switch $style { |
soma {proto_show_nodes_from_list_soma_only $myNodeIdList $colorMethod $defaultScaling} | soma {proto_show_nodes_from_list_soma_only $myNodeIdList $colorMethod $defaultScaling $resolution} |
morphology {proto_show_nodes_from_list_morpho_spheretube $myNodeIdList $colorMethod $defaultScaling} | morphology {proto_show_nodes_from_list_morpho_spheretube $myNodeIdList $colorMethod $defaultScaling} |
morphology_draft {proto_show_nodes_from_list $myNodeIdList $colorMethod $defaultScaling} | morphology_draft {proto_show_nodes_from_list $myNodeIdList $colorMethod $defaultScaling} |
morphology_line {proto_show_nodes_from_list_morpho_line $myNodeIdList $colorMethod $defaultScaling} | morphology_line {proto_show_nodes_from_list_morpho_line $myNodeIdList $colorMethod $defaultScaling} |
| |
} | } |
} | } |
| |
proc ::neuro::cmd_mod_rep_node_gid_list {repIndex style colorMethod material scaling resolution gid_list {stride 1} {v1_special_skip False}} { | proc ::neuro::cmd_mod_rep_node_gid_list {repid style colorMethod material scaling resolution gid_list {stride 1} {v1_special_skip False}} { |
# XX special stride parameter is temporary for testing - stride will be a part of proper selection language with boolean and nested-parenthesis selections | # XX special stride parameter is temporary for testing - stride will be a part of proper selection language with boolean and nested-parenthesis selections |
variable nrepList | variable nrepList |
variable nrepCount | variable nrepCount |
| set repIndex [lsearch -exact -index 0 -integer $nrepList $repid] |
# number of created nreps. At initVars, set to 0. Also is the index of the next nrep to be created, so first nrep created has index 0. | # number of created nreps. At initVars, set to 0. Also is the index of the next nrep to be created, so first nrep created has index 0. |
variable display_virtuals_at_creation | variable display_virtuals_at_creation |
variable globalNodeIdList | variable globalNodeIdList |
set myNodeIdList $gid_list | set myNodeIdList $gid_list |
set displayed_virtuals_at_creation [lindex $nrepList $repIndex 9] | set displayed_virtuals_at_creation [lindex $nrepList $repIndex 9] |
| |
# use nrep for "neuro represenation" so not confused with internal VMD reps. | # use nrep for "neuro represenation" so not confused with internal VMD reps. |
# Note that for this implementation, there is one nrep per molecule. | # Note that for this implementation, there is one nrep per molecule. |
# | # |
| |
set nrepList [lreplace $nrepList $repIndex $repIndex [list $oldNrepid $shown $molec $style $colorMethod $material "global_id == $globalNodeIdList" $stride $num_neurons $displayed_virtuals_at_creation $scaling $resolution]] | set nrepList [lreplace $nrepList $repIndex $repIndex [list $oldNrepid $shown $molec $style $colorMethod $material "global_id == $globalNodeIdList" $stride $num_neurons $displayed_virtuals_at_creation $scaling $resolution]] |
| |
switch $style { | switch $style { |
soma {proto_show_nodes_from_list_soma_only $myNodeIdList $colorMethod $scaling} | soma {proto_show_nodes_from_list_soma_only $myNodeIdList $colorMethod $scaling $resolution} |
morphology_draft {proto_show_nodes_from_list $myNodeIdList $colorMethod $scaling} | morphology_draft {proto_show_nodes_from_list $myNodeIdList $colorMethod $scaling} |
morphology {proto_show_nodes_from_list_morpho_spheretube $myNodeIdList $colorMethod $scaling} | morphology {proto_show_nodes_from_list_morpho_spheretube $myNodeIdList $colorMethod $scaling} |
morphology_line {proto_show_nodes_from_list_morpho_line $myNodeIdList $colorMethod $scaling} | morphology_line {proto_show_nodes_from_list_morpho_line $myNodeIdList $colorMethod $scaling} |
| |
set nrepList [lreplace $nrepList $repIndex $repIndex [list $oldNrepid $shown $molec $style $colorMethod $material $full_selection_string $stride $num_neurons $displayed_virtuals_at_creation $scaling $resolution]] | set nrepList [lreplace $nrepList $repIndex $repIndex [list $oldNrepid $shown $molec $style $colorMethod $material $full_selection_string $stride $num_neurons $displayed_virtuals_at_creation $scaling $resolution]] |
| |
switch $style { | switch $style { |
soma {proto_show_nodes_from_list_soma_only $myNodeIdList $colorMethod $scaling} | soma {proto_show_nodes_from_list_soma_only $myNodeIdList $colorMethod $scaling $resolution} |
morphology_draft {proto_show_nodes_from_list $myNodeIdList $colorMethod $scaling} | morphology_draft {proto_show_nodes_from_list $myNodeIdList $colorMethod $scaling} |
morphology {proto_show_nodes_from_list_morpho_spheretube $myNodeIdList $colorMethod $scaling} | morphology {proto_show_nodes_from_list_morpho_spheretube $myNodeIdList $colorMethod $scaling} |
morphology_line {proto_show_nodes_from_list_morpho_line $myNodeIdList $colorMethod $scaling} | morphology_line {proto_show_nodes_from_list_morpho_line $myNodeIdList $colorMethod $scaling} |