diff --git a/control/region.proto b/control/region.proto index 6d84f6d..3aa8ede 100644 --- a/control/region.proto +++ b/control/region.proto @@ -12,6 +12,8 @@ message SetRegion { sfixed32 region_id = 2; // Region parameters RegionInfo region_info = 3; + // Update region for pv preview only + bool preview_region = 4; } diff --git a/control/stop_pv_calc.proto b/control/stop_pv_calc.proto index c28ca32..92695bf 100644 --- a/control/stop_pv_calc.proto +++ b/control/stop_pv_calc.proto @@ -2,6 +2,16 @@ syntax = "proto3"; package CARTA; message StopPvCalc { - // Stop the PV image calculation with respect to the image file id + // Stop the PV image calculation for the image file id sfixed32 file_id = 1; } + +message StopPvPreview { + // Stop the PV preview for the preview viewer id + sfixed32 preview_id = 1; +} + +message ClosePvPreview { + // Close the PV preview for the preview viewer id + sfixed32 preview_id = 1; +} diff --git a/docs/src/changelog.rst.txt b/docs/src/changelog.rst.txt index 4b5bdc1..4fdbc53 100644 --- a/docs/src/changelog.rst.txt +++ b/docs/src/changelog.rst.txt @@ -188,7 +188,7 @@ Changelog - Added ``keep`` to :carta:ref:`MomentRequest` message. * - ``28.4.0`` - 05/12/22 - - Added additional fields to :carta:ref:`FittingRequest` and :carta:ref:`FittingResponse` for generating model and residual images. Added :carta:ref:`FittingProgress` and :carta:ref:`StopFitting` messages for updaing progress and canceling tasks. + - Added additional fields to :carta:ref:`FittingRequest` and :carta:ref:`FittingResponse` for generating model and residual images. Added :carta:ref:`FittingProgress` and :carta:ref:`StopFitting` messages for updating progress and canceling tasks. * - ``28.5.0`` - 10/01/23 - Added axes numbers to :carta:ref:`FileInfoExtended` message for dealing with swapped axes image cubes. @@ -201,6 +201,9 @@ Changelog * - ``28.8.0`` - 14/04/23 - Added number of bins and pixel bounds to :carta:ref:`HistogramConfig` in :carta:ref:`SetHistogramRequirements` message. Added :carta:ref:`HistogramConfig` to :carta:ref:`RegionHistogramData` message. + * - ``28.9.0`` + - 28/04/23 + - Added sub-message :carta:ref:`PvPreviewSettings` to :carta:ref:`PvRequest` and message :carta:ref:`PvPreviewData` to :carta:ref:`PvResponse` for generating a PV preview image. Added :carta:ref:`StopPvPreview` to cancel preview image and :carta:ref:`ClosePvPreview` to release preview resources. Versioning ---------- diff --git a/docs/src/defs.rst.txt b/docs/src/defs.rst.txt index 2ad44a8..78894cc 100644 --- a/docs/src/defs.rst.txt +++ b/docs/src/defs.rst.txt @@ -984,6 +984,55 @@ Source file: `shared/defs.proto `_ + +Preview parameters of a :carta:refc:`PV_REQUEST` + +.. list-table:: + :widths: 20 20 20 40 + :header-rows: 1 + :class: proto + + * - Field + - Type + - Label + - Description + * - preview_id + - sfixed32 + - + - Preview ID for the PV preview viewer + * - region_id + - sfixed32 + - + - Region ID for the subimage in the xy plane + * - rebin_xy + - sfixed32 + - + - Downsampling in xy axes + * - rebin_z + - sfixed32 + - + - Downsampling in z axis + * - compression_type + - :carta:refc:`CompressionType` + - + - The compression algorithm to use + * - image_compression_quality + - float + - + - Compression quality from frontend performance preferences + * - animation_compression_quality + - float + - + - + .. carta:class:: carta-sub regioninfo .. _regioninfo: diff --git a/docs/src/enums.rst.txt b/docs/src/enums.rst.txt index a43ee67..d23d6e6 100644 --- a/docs/src/enums.rst.txt +++ b/docs/src/enums.rst.txt @@ -531,6 +531,15 @@ Source file: `shared/enums.proto `_ + + + +.. list-table:: + :widths: 20 20 20 40 + :header-rows: 1 + :class: proto + + * - Field + - Type + - Label + - Description + * - preview_id + - sfixed32 + - + - Close the PV preview for the preview viewer id + .. carta:class:: carta-f2b concatstokesfiles .. _concatstokesfiles: @@ -1415,6 +1440,67 @@ Response for :carta:refc:`OPEN_FILE`. Also supplies file information - repeated - :carta:refc:`Beam` table for multiple-beam images +.. carta:class:: carta-b2f pvpreviewdata + +.. _pvpreviewdata: + +PvPreviewData +~~~~~~~~~~~~~ + +Source file: `stream/pv_preview.proto `_ + +Data stream for PV preview image + +.. list-table:: + :widths: 20 20 20 40 + :header-rows: 1 + :class: proto + + * - Field + - Type + - Label + - Description + * - preview_id + - sfixed32 + - + - Preview ID for the PV preview viewer + * - image_info + - :carta:refc:`FileInfoExtended` + - + - Image extended file info + * - image_data + - bytes + - + - Image data. For uncompressed data, this is converted into FP32, while for compressed data, this is passed to the compression library for decompression. + * - nan_encodings + - bytes + - + - Run-length encodings of NaN values used to restore the NaN values after decompression. + * - width + - sfixed32 + - + - Dimensions of data + * - height + - sfixed32 + - + - + * - compression_type + - :carta:refc:`CompressionType` + - + - The compression algorithm used + * - compression_quality + - float + - + - Compression quality switch + * - histogram_bounds + - :carta:refc:`FloatBounds` + - + - :carta:refc:`Histogram` min/max, for rendering + * - histogram + - :carta:refc:`Histogram` + - + - :carta:refc:`Histogram`, to tune rendering + .. carta:class:: carta-b2f pvprogress .. _pvprogress: @@ -1438,11 +1524,15 @@ Source file: `request/pv_request.proto `_ + + + +.. list-table:: + :widths: 20 20 20 40 + :header-rows: 1 + :class: proto + + * - Field + - Type + - Label + - Description + * - preview_id + - sfixed32 + - + - Stop the PV preview for the preview viewer id .. carta:class:: carta-b2f vectoroverlaytiledata diff --git a/request/pv_request.proto b/request/pv_request.proto index 453d0e1..73e7e6d 100644 --- a/request/pv_request.proto +++ b/request/pv_request.proto @@ -3,24 +3,43 @@ package CARTA; import "defs.proto"; import "open_file.proto"; +import "pv_preview.proto"; message PvRequest { + // File ID of the source image sfixed32 file_id = 1; + // Region ID of the PV cut in the source image sfixed32 region_id = 2; + // Averaging width along PV cut sfixed32 width = 3; + // Range of channels to be used in velocity axis IntBounds spectral_range = 4; + // Flag whether to generate [Spatial, Spectral] image or reverse bool reverse = 5; + // Flag whether to keep or replace previously-generated images bool keep = 6; + // Parameters for preview mode + PvPreviewSettings preview_settings = 7; } message PvResponse { + // Defines whether PV_REQUEST was successful bool success = 1; + // Error message (if applicable) string message = 2; + // PV generator result: generated PV image OpenFileAck open_file_ack = 3; - bool cancel = 4; + // PV preview result: generated PV image + PvPreviewData preview_data = 4; + // Defines whether PV_REQUEST was canceled + bool cancel = 5; } message PvProgress { + // File ID of the source image for the PV generator sfixed32 file_id = 1; - float progress = 2; + // Preview ID of the PV preview viewer + sfixed32 preview_id = 2; + // Progress indicator, ranging from 0 to 1 + float progress = 3; } diff --git a/shared/defs.proto b/shared/defs.proto index 7cf9473..4d1df66 100644 --- a/shared/defs.proto +++ b/shared/defs.proto @@ -292,3 +292,20 @@ message GaussianComponent { // position angle in degrees double pa = 4; } + +// Preview parameters of a PV_REQUEST +message PvPreviewSettings { + // Preview ID for the PV preview viewer + sfixed32 preview_id = 1; + // Region ID for the subimage in the xy plane + sfixed32 region_id = 2; + // Downsampling in xy axes + sfixed32 rebin_xy = 3; + // Downsampling in z axis + sfixed32 rebin_z = 4; + // The compression algorithm to use + CompressionType compression_type = 5; + // Compression quality from frontend performance preferences + float image_compression_quality = 6; + float animation_compression_quality = 7; +} diff --git a/shared/enums.proto b/shared/enums.proto index 8248cc2..6e998c7 100644 --- a/shared/enums.proto +++ b/shared/enums.proto @@ -77,6 +77,9 @@ enum EventType { VECTOR_OVERLAY_TILE_DATA = 82; FITTING_PROGRESS = 83; STOP_FITTING = 84; + PV_PREVIEW_DATA = 85; + STOP_PV_PREVIEW = 86; + CLOSE_PV_PREVIEW = 87; } enum SessionType { diff --git a/stream/pv_preview.proto b/stream/pv_preview.proto new file mode 100644 index 0000000..6cc8045 --- /dev/null +++ b/stream/pv_preview.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package CARTA; + +import "defs.proto"; +import "enums.proto"; + +// Data stream for PV preview image +message PvPreviewData { + // Preview ID for the PV preview viewer + sfixed32 preview_id = 1; + // Image extended file info + FileInfoExtended image_info = 2; + // Image data. For uncompressed data, this is converted into FP32, while for compressed data, + // this is passed to the compression library for decompression. + bytes image_data = 3; + // Run-length encodings of NaN values used to restore the NaN values after decompression. + bytes nan_encodings = 4; + // Dimensions of data + sfixed32 width = 5; + sfixed32 height = 6; + // The compression algorithm used + CompressionType compression_type = 7; + // Compression quality switch + float compression_quality = 8; + // Histogram min/max, for rendering + FloatBounds histogram_bounds = 9; + // Histogram, to tune rendering + Histogram histogram = 10; +}