Page 1 of 1

rotate a .asc neurolucida morphology file and save it

Posted: Tue May 10, 2016 8:22 am
by youngJose
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.

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

Posted: Tue May 10, 2016 10:56 am
by ted
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.

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

Posted: Tue May 17, 2016 8:13 am
by youngJose
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!