Skip to content

The inderence only works with isometric pixel spacing #4

@mariamonzon

Description

@mariamonzon

In the tutorial page thre is an example of NIFTI predictions whre the pixel spacing is
sx, sy, sz = image.header.get_zooms() # get pixel spacings

However when calling the detection function is specified as
vert_dicts = spnt.detect_vb(scan.volume, scan.pixel_spacing[0])

In the case tat would like to use the both pixel spacing the function detect_vb throus an error, despite in teh definition in theory allow .
def detect_vb(
self,
volume : np.ndarray,
pixel_spacing : Union[np.ndarray, List[float], torch.Tensor],
debug: bool = False,
penalise_skips: bool = True,
remove_single_slice_detections: bool = True,
) -> VertDicts:
"""
Use SpineNet to detect and label vertebral bodies in a volume.

    Parameters
    ----------
    volume : np.ndarray
        The volume to detect vertebrae in. Should have shape (height,width, number of sagittal slices).
    pixel_spacing : Union[np.ndarray, List[float], torch.Tensor]
        The pixel spacing of the volume, specifically the distance between adjacent pixels in the sagittal direction.
        This has order height, width

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions