dsb-2017 icon indicating copy to clipboard operation
dsb-2017 copied to clipboard

HU value and the coordinates

Open Bonsen opened this issue 7 years ago • 3 comments

hi anlthms, 1.mask = np.array(image > -320, dtype=np.int8) the '-320' is HU value,but u just use it on array value....

2.coord_z,coord_y,coord_x are the world coordinates.After you run
slices = ndimage.interpolation.zoom(data, spacing, mode='nearest') , u should convert the world coordinates to voxel coordinates using the origin and spacing of the ct_scan, like: ''' def world_2_voxel(world_coordinates, origin, spacing): stretched_voxel_coordinates = np.absolute(world_coordinates - origin) voxel_coordinates = stretched_voxel_coordinates / spacing return voxel_coordinates '''

Bonsen avatar Apr 01 '17 13:04 Bonsen

Hi Bonsen, Do you mean anlthms should change to voxel coordinates before creating mask?

Best, Feng

parkerzf avatar Apr 01 '17 17:04 parkerzf

@parkerzf sorry, I find the newspacing may be [ 1. 0.9999996 0.9999996] So, it equels to [1,1,1] and "convert" makes no difference.

Bonsen avatar Apr 03 '17 15:04 Bonsen

  1. Not sure I understand the issue.

  2. Conversion from world coordinates to voxel coordinates is done here: https://github.com/anlthms/dsb-2017/blob/master/convert.py#L54.

anlthms avatar Apr 07 '17 20:04 anlthms