export type GetApiInstancesIdFramesFrameImageInt16Args = {quality?: number | undefined, returnUnsupportedImage?: boolean | undefined, Accept?: string | undefined, frame: number, id: string}; export type GetApiInstancesIdFramesFrameImageInt16Options = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Decode a frame (int16) * * GET /instances/{id}/frames/{frame}/image-int16 */ export const getApiInstancesIdFramesFrameImageInt16 = async (args: GetApiInstancesIdFramesFrameImageInt16Args, options?: GetApiInstancesIdFramesFrameImageInt16Options) => { const {baseUrl = "https://orthanc.uclouvain.be/demo", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "image/jpeg") if (args.quality != null) query.append("quality", String(args.quality)) if (args.returnUnsupportedImage != null) query.append("returnUnsupportedImage", String(args.returnUnsupportedImage)) if (args.Accept != null) headers.set("Accept", String(args.Accept)) const url = `${baseUrl.replace(/\/+$/, '')}/instances/${encodeURIComponent(String(args.id))}/frames/${encodeURIComponent(String(args.frame))}/image-int16${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };