rotate a .asc neurolucida morphology file and save it

Managing anatomically complex model cells with the CellBuilder. Importing morphometric data with NEURON's Import3D tool or Robert Cannon's CVAPP. Where to find detailed morphometric data.
Post Reply
youngJose

rotate a .asc neurolucida morphology file and save it

Post by youngJose » Tue May 10, 2016 8:22 am

Hi,
I want to rotate a neurolucida file (.asc) about y axis for 180 deg, and save it as a .hoc file.
I've already checked the import 3D tutorial, and I tried to use "rotate 45deg about y axis" in Import 3D.
However, I found it's just for visualization, it won't affect the morphology when you export the morphology from Import 3D to CellBuilder.
So is there any way to rotate a morphology about y axis and save the result into .hoc file? No matter using GUI tool in NEURON or using HOC language to do it.

Many thanks in adavance.

ted
Site Admin
Posts: 5624
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: rotate a .asc neurolucida morphology file and save it

Post by ted » Tue May 10, 2016 10:56 am

youngJose wrote:I want to rotate a neurolucida file (.asc) about y axis for 180 deg, and save it as a .hoc file.
Possible ways that you might do this:
1. Maybe MicroBrightField or someone else has a program that can apply the rotational transformation to data in a NeuroLucida file. If so, do that first, then use NEURON's Import3d tool to import the new NeuroLucida file.
2. If there isn't a program that can apply the rotation to a NeuroLucida file, then figure out the file format and write your own. 180 degree rotation around the y axis is equivalent to multiplying each x and z coordinate by -1. Then use Import3d.

Easier than the second approach might be this: just use Import3d to generate a hoc file from the original NeuroLucida file, then make a copy of that hoc file and multiply each x and z coordinate in that file by -1. Easy to do with awk or any programming language that has rudimentary string functions.

youngJose

Re: rotate a .asc neurolucida morphology file and save it

Post by youngJose » Tue May 17, 2016 8:13 am

ted wrote:
youngJose wrote:I want to rotate a neurolucida file (.asc) about y axis for 180 deg, and save it as a .hoc file.
Possible ways that you might do this:
1. Maybe MicroBrightField or someone else has a program that can apply the rotational transformation to data in a NeuroLucida file. If so, do that first, then use NEURON's Import3d tool to import the new NeuroLucida file.
2. If there isn't a program that can apply the rotation to a NeuroLucida file, then figure out the file format and write your own. 180 degree rotation around the y axis is equivalent to multiplying each x and z coordinate by -1. Then use Import3d.

Easier than the second approach might be this: just use Import3d to generate a hoc file from the original NeuroLucida file, then make a copy of that hoc file and multiply each x and z coordinate in that file by -1. Easy to do with awk or any programming language that has rudimentary string functions.
Thank you, Ted!

Post Reply