Skip to content

DCMPix

DCMPix is a class of objects contained within a 2D OsiriX viewer. It contains information about the displayed image, including the number fo rows/columns, the source file from which it is generated, whether it is greyscale of ARGB format, and ultimately the pixel data.

Type

All types only contain a single parameter, the UUID of the underlying OsiriX object.

types.proto (lines 17-19)
message DCMPix{
    string osirixrpc_uid = 1;
}

Methods

By convention, any method defined with syntax

rpc DCMPixXyz (DCMPixXyzRequest) returns (DCMPixXyzResponse) {}
is called in Python (for example) using syntax
response = osirix_stub.DCMPixXyz(request) # (1)

  1. response is a DCMPixXyzResponse class, and request a DCMPixXyzRequest class.
osirix.proto (lines 66-82)
rpc DCMPixConvertToRGB (DCMPixConvertToRGBRequest) returns (Response) {}
rpc DCMPixConvertToBW (DCMPixConvertToBWRequest) returns (Response) {}
rpc DCMPixIsRGB (DCMPix) returns (DCMPixIsRGBResponse) {}
rpc DCMPixComputeROI (DCMPixComputeROIRequest) returns (DCMPixComputeROIResponse) {}
rpc DCMPixROIValues (DCMPixROIValuesRequest) returns (DCMPixROIValuesResponse) {}
rpc DCMPixShape (DCMPix) returns (DCMPixShapeResponse) {}
rpc DCMPixSpacing (DCMPix) returns (DCMPixSpacingResponse) {}
rpc DCMPixOrigin (DCMPix) returns (DCMPixOriginResponse) {}
rpc DCMPixOrientation (DCMPix) returns (DCMPixOrientationResponse) {}
rpc DCMPixSliceLocation (DCMPix) returns (DCMPixSliceLocationResponse) {}
rpc DCMPixSourceFile (DCMPix) returns (DCMPixSourceFileResponse) {}
rpc DCMPixImage (DCMPix) returns (DCMPixImageResponse) {}
rpc DCMPixSetImage (DCMPixSetImageRequest) returns (Response) {}
rpc DCMPixGetMapFromROI (DCMPixGetMapFromROIRequest) returns (DCMPixGetMapFromROIResponse) {}
rpc DCMPixDicomImage (DCMPix) returns (DCMPixDicomImageResponse) {}
rpc DCMPixDicomSeries (DCMPix) returns (DCMPixDicomSeriesResponse) {}
rpc DCMPixDicomStudy (DCMPix) returns (DCMPixDicomStudyResponse) {}

Responses

By convention, any response defined with syntax

message DCMPixXyzResponse{
    type_1 arg_1 = 1;
    type_2 arg_2 = 2; // (1)
    ...
}

  1. The numbers on the RHS should be ignored. They are necessary only for protobuf file definitions.

has attributes accessed in Python (for example) using syntax

x1 = response.arg1
x2 = response.arg2
...

dcmpix.proto (lines 9-95)
message DCMPixIsRGBResponse{
    Status status = 1;
    bool is_rgb = 2;
}

message DCMPixComputeROIResponse{
    Status status = 1;
    float mean = 2;
    float total = 3;
    float std_dev = 4;
    float min = 5;
    float max = 6;
    float skewness = 7;
    float kurtosis = 8;
}

message DCMPixROIValuesResponse{
    Status status = 1;
    repeated float values = 2;
    repeated int32 row_indices = 3;
    repeated int32 column_indices = 4;
}

message DCMPixDicomImageResponse{
    Status status = 1;
    DicomImage dicom_image = 2;
}

message DCMPixDicomSeriesResponse{
    Status status = 1;
    DicomSeries dicom_series = 2;
}

message DCMPixDicomStudyResponse{
    Status status = 1;
    DicomStudy dicom_study = 2;
}

message DCMPixImageResponse{
    Status status = 1;
    int32 rows = 2;
    int32 columns = 3;
    bool is_argb = 4;
    repeated float image_data_float = 5;
    repeated int32 image_data_argb = 6;
}

message DCMPixGetMapFromROIResponse{
    Status status = 1;
    int32 rows = 2;
    int32 columns = 3;
    repeated bool map = 4;
}

message DCMPixShapeResponse{
    Status status = 1;
    int32 rows = 2;
    int32 columns = 3;
}

message DCMPixSpacingResponse{
    Status status = 1;
    float spacing_rows = 2;
    float spacing_columns = 3;
}

message DCMPixOriginResponse{
    Status status = 1;
    float origin_x = 2;
    float origin_y = 3;
    float origin_z = 4;
}

message DCMPixOrientationResponse{
    Status status = 1;
    repeated float orientation = 2;
}

message DCMPixSliceLocationResponse{
    Status status = 1;
    float slice_location = 2;
}

message DCMPixSourceFileResponse{
    Status status = 1;
    string source_file = 2;
}

Requests

By convention, any request defined with syntax

message DCMPixXyzRequest{
    type_1 arg_1 = 1;
    type_2 arg_2 = 2; // (1)
    ...
}

  1. The numbers on the RHS should be ignored. They are necessary only for protobuf file definitions.

is created in Python (for example) using syntax

from osirixgrpc import dcmpix_pb2

request = dcmpix_pb2.DCMPixXyzRequest(arg1 = x1, arg2 = x2, ...)

dcmpix.proto (lines 98-)
message DCMPixConvertToRGBRequest{
    DCMPix pix = 1;
    int32 rgb_channel = 2;
}

message DCMPixConvertToBWRequest{
    DCMPix pix = 1;
    int32 bw_channel = 2;
}

message DCMPixComputeROIRequest{
    DCMPix pix = 1;
    ROI roi = 2;
}

message DCMPixROIValuesRequest{
    DCMPix pix = 1;
    ROI roi = 2;
}

message DCMPixSetImageRequest{
    DCMPix pix = 1;
    repeated float image_data_float = 2;
    repeated int32 image_data_argb = 3;
}

message DCMPixGetMapFromROIRequest{
    DCMPix pix = 1;
    ROI roi = 2;
}