LCSR-CIIS / ambf_util_slicer_plugin

some utilities for quickly converting volumes, markups from 3DSlicer into format accepted by AMBF simulator
BSD 2-Clause "Simplified" License
3 stars 3 forks source link

The calculated dimensions should take into account image spacing #8

Closed adnanmunawar closed 1 year ago

adnanmunawar commented 1 year ago

For a volume the "dimensions" in 3D Slicer represent voxel count while in AMBF they represent simulator units (which we should consider as SI). Therefore we should take into account the Slicer "spacing" field and multiply it by the "dimensions" to get dimensions in mm and convert the to m before writing to ADF.

htp2 commented 1 year ago

Great catch! :+1: Looking at the commit history, this used to work, but appears to have fallen out in a previous edit.

I think it boils down to a naming disagreement: In AMBF the "dimension" term is in meters, in Slicer it refers to the array dimension (i.e. number of voxels in each dimension).

We need to do ambf_dimensions = (slicer_spacing .* slicer_dimensions).

I'll assign this to me, but it should be a pretty easy fix if someone needs it before I can get to it.

htp2 commented 1 year ago

Could you please take a look at the changes in #9 and see if they address the behavior you were seeing? @adnanmunawar

adnanmunawar commented 1 year ago

Hi Henry, just tested this and the new dimensions seem to be correct now. Thanks

htp2 commented 1 year ago

Great, I've merged it in now, thanks