[MINC-users] ray_trace issue!

Mishkin Derakhshan mishkind at gmail.com
Fri Jul 9 16:09:57 EDT 2010


It seems I found a workaround.

If you first copy the volume and then edit the mincheader so that the
direction cosines read

		zspace:direction_cosines = 0., 0., 0. ;
		yspace:direction_cosines = 0., 0., 0. ;
		xspace:direction_cosines = 0., 0., 0. ;

And do make_slice on this new file just to get your slice.obj file
then all works fine:

make_slice without_direction_cosines.mnc.gz slice.obj z w 55 2 2
plane_polygon_intersect lh.pial.obj lh.pial.lines.obj  z 55
set_object_colour lh.pial.lines.obj lh.pial.green.obj green
ray_trace -output ex14.rgb -nolight lh.pial.green.obj -gray 0 200
T1.mnc.gz 0 1 slice.obj -bg white -top

This seems like a bug in make_slice somewhere but after rigorously
testing this method (n=1), I'm now ready to move on ;)

mishkin


On Fri, Jul 9, 2010 at 11:47 AM, Mishkin Derakhshan <mishkind at gmail.com> wrote:
> Hi,
>
> Lasse, did you ever find a workaround for this problem? I too am
> having difficulties with the planes not being exactly the same. The
> result is that ray_trace only renders about half of the object as the
> other half falls just out of plane.
>
> Ex:
> make_slice T1.mnc.gz slice.obj z w 55
> plane_polygon_intersect lh.pial.obj lh.pial.lines.obj  z 55
> set_object_colour lh.pial.lines.obj lh.pial.green.obj green
> ray_trace -output ex14.rgb -nolight lh.pial.green.obj -gray 0 200
> T1.mnc.gz 0 1 slice.obj -bg white -top
>
> screenshot of output:
> http://imgur.com/CK27d.png
>
> Are David MacDonald's instructions #14 still the best approach, and
> what other people are using?
> http://www.bic.mni.mcgill.ca/users/david/Ray_trace/ray_trace_tutorial.html#Ex14
>
> As a follow up, I am trying to render two objects on the same plane.
> Has anyone done this before?
>
> thanks,
> mishkin
>
>
> 2008/5/19 Lasse Riis Østergaard <lasse at hst.aau.dk>:
>> Hi again
>>
>> I now see that the issue is related to make_slice and not ray_trace!
>>
>> In the example I provided make_slice creates this:
>>
>> Q 0.3 0.3 0.4 10 1 2 2 F F
>>  0 1 1 1 1
>>
>>  98.8034 140.093 0.842139
>>  98.8034 -59.1943 6.75685
>>  -100.572 140.093 0.842139
>>  -100.572 -59.1943 6.75685
>>
>>  0 0 1
>>  0 0 1
>>  0 0 1
>>  0 0 1
>>
>> I had expected a constant z-value of 5. Does make_slice find the closest
>> slice in voxel space?
>>
>> Lasse
>>
>> Lasse Riis Østergaard wrote:
>>> Hi
>>>
>>> Any ray_trace experts here?
>>>
>>> I am using ray_trace to render images of surface cross sections on  top
>>> of volume cross sections. I have been following the steps in David's
>>> tutorial (Example 14). This works very fine if the z-axis in world and
>>> voxel space are parallel. If this is not the case their seem to be an
>>> issue with the texture mapping as the gray levels are not interpolated
>>> correct!
>>>
>>> Here is what I do:
>>>
>>> 1. make_slice volume.mnc slice.obj z w 5 2 2
>>> 2. plane_polygon_intersect surface.obj lines.obj z 5
>>> 3.  ray_trace -output image.rgb -nolight -line_width 1 lines.obj -gray 0
>>> 300 volume.mnc 0 1 slice.obj -size 1024 1024 -bg white -crop -top -sup 3
>>>
>>> ray_trace maps the grey levels of a slice along the z-axis in voxel
>>> space - not in world space!
>>>
>>> By inspection I have found that the rendered slice exactly corresponds
>>> to z=78 (voxel space) wich cuts through z-coordinates 0.9-6.8 in world
>>> space.
>>>
>>> Am I doing anything wrong?
>>>
>>> cheers
>>> Lasse
>>> _______________________________________________
>>> MINC-users at bic.mni.mcgill.ca
>>> http://www2.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>>>
>>
>> _______________________________________________
>> MINC-users at bic.mni.mcgill.ca
>> http://www2.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>>
>


More information about the MINC-users mailing list