cod-retrieve
Version:
A repo to retrieve/ download study dicom files in the specified local folder.
38 lines (37 loc) • 1.84 kB
TypeScript
import Job from "./Job";
import { BucketDetails, DownloadStats, ExtractedCallbackFn, ExtractedTarFile, SavedCallbackFn } from "../types";
export declare const IDB_DIR_HANDLE_KEY = "indexed_db_directory_handle_key";
declare class CodDownload {
private directoryHandle;
private logs;
private bucketDetails;
private headers;
private metadata;
private filesSaved;
private filesToFetch;
private stats;
initDirectory(usePrivateStorage?: boolean): Promise<void>;
initBucket(bucketDetails: string | BucketDetails): void;
getStats(studyInstanceUIDs: string[]): Promise<DownloadStats | undefined>;
download(studyInstanceUIDs: string[], zipOutput?: boolean): Promise<Job>;
getLogs(): Promise<void>;
updateLogs(): Promise<void>;
parseBucketDetails(bucketDetails: string): void;
fetchStudyMetadata(studyInstanceUIDs: string[]): Promise<void>;
calculateStats(): void;
handleZipping(): Promise<void>;
handleSavingTarFiles(url: string, tarFile: ArrayBuffer, extractedCallbacks: ExtractedCallbackFn[], savedCallbacks: SavedCallbackFn[]): Promise<void>;
handleSavingIndividualFiles(url: string, tarFile: ArrayBuffer, extractedCallbacks: ExtractedCallbackFn[], savedCallbacks: SavedCallbackFn[]): Promise<void>;
readDirectory(dirHandle: FileSystemDirectoryHandle, rootPath?: string): Promise<{
name: string;
file: File;
}[]>;
private buildFolderTree;
readFileFromFileSystem(name: string, dirHandle?: FileSystemDirectoryHandle): Promise<File | undefined>;
untarTarFile(arrayBuffer: ArrayBuffer): Promise<ExtractedTarFile[]>;
createLogString(studyInstanceUID: string, seriesInstanceUID: string, sopInstanceUID?: string): string;
private handleError;
reset(): void;
}
declare const codDownload: CodDownload;
export default codDownload;