1import type * as medicalimaging from "@distilled.cloud/aws/medical-imaging";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Datastore } from "./Datastore.ts";
5
6/**
7 * `GetImageFrame` request with `datastoreId` injected from the bound data
8 * store.
9 */
10export interface GetImageFrameRequest extends Omit<
11 medicalimaging.GetImageFrameRequest,
12 "datastoreId"
13> {}
14
15/**
16 * Runtime binding for the `GetImageFrame` operation (IAM action
17 * `medical-imaging:GetImageFrame`), scoped to one {@link Datastore}.
18 *
19 * Streams the pixel data of a single image frame (HTJ2K- or
20 * JPEG2000-encoded, per the data store's `losslessStorageFormat`). Image
21 * frame ids come from the image set metadata blob read with
22 * {@link GetImageSetMetadata}. Provide the implementation with
23 * `Effect.provide(AWS.MedicalImaging.GetImageFrameHttp)`.
24 *
25 * ### Reading Image Frames
26 * **Example:** Fetch an Image Frame's Pixel Data
27 * ```typescript
28 * const getImageFrame = yield* MedicalImaging.GetImageFrame(datastore);
29 *
30 * const frame = yield* getImageFrame({
31 * imageSetId,
32 * imageFrameInformation: { imageFrameId },
33 * });
34 * // frame.imageFrameBlob (streaming body), frame.contentType
35 * ```
36 *
37 * @binding
38 */
39export interface GetImageFrame extends Binding.Service<
40 GetImageFrame,
41 "AWS.MedicalImaging.GetImageFrame",
42 (
43 datastore: Datastore,
44 ) => Effect.Effect<
45 (
46 request: GetImageFrameRequest,
47 ) => Effect.Effect<
48 medicalimaging.GetImageFrameResponse,
49 medicalimaging.GetImageFrameError
50 >
51 >
52> {}
53export const GetImageFrame = Binding.Service<GetImageFrame>(
54 "AWS.MedicalImaging.GetImageFrame",
55);