ingrese la descripción de la imagen aquí
Dicom Url está en la variable viewFile, cuando lo paso a la función LoaddicomImages da error, solo los datos del tipo lista de archivos deben pasarse a la función. No puedo cambiar el tipo de lista de archivos del argumento de la función porque es obligatorio mantener el tipo lista de archivos.
export class ViewerComponent implements OnInit { @ViewChild(DICOMViewerComponent, { static: true }) viewPort: DICOMViewerComponent; viewFile: any; constructor(private router: Router) { this.viewFile = this.router.getCurrentNavigation().extras.state['item']; console.log(this.viewFile); } ngOnInit() { cornerstoneWADOImageLoader.external.cornerstone = cornerstone; // inicializa WADO Image loader // configura codecs e web workers cornerstoneWADOImageLoader.webWorkerManager.initialize({ webWorkerPath: './assets/cornerstone/webworkers/cornerstoneWADOImageLoaderWebWorker.js', taskConfiguration: { 'decodeTask': { codecsPath: '../codecs/cornerstoneWADOImageLoaderCodecs.js' } } }); this.loadDICOMImages(this.viewFile) } /** * Load selected DICOM images * * @param files list of selected dicom files */ loadDICOMImages(files : FileList) { console.log(files) if (files && files.length > 0) { let imageList = []; const fileList:Array<File> = Array.from(files); fileList.sort((a,b) => { if ( a.name > b.name ) return 1; if ( b.name > a.name ) return -1; return 0; }) cornerstoneWADOImageLoader.wadouri.fileManager.purge(); // cornerstoneWADOImageLoader.wadouri.dataSetCacheManager.purge(); // loop thru the File list and build a list of wadouri imageIds (dicomfile:) for (let i = 0; i < fileList.length; i++) { const dicomFile: File = fileList[i]; const imageId = cornerstoneWADOImageLoader.wadouri.fileManager.add(dicomFile); imageList.push(imageId); } this.viewPort.resetAllTools(); // now load all Images, using their wadouri this.viewPort.loadStudyImages(imageList); } else alert('Choose DICOM images to display.'); } }