hong-haier / WPF.MedicalImaging

使用WPF实现医疗影像数据Dicom的查看 DicomViewer
BSD 3-Clause "New" or "Revised" License
3 stars 3 forks source link

DICOM file not opened~ #1

Open Flowergift opened 3 months ago

Flowergift commented 3 months ago

1

Dear hong-haier,

I've tested your code in my PC (Same with your envir : Win11 + VS2022)

But...

Something is unexpected.

Can you check your code? Or can you let me some helps to "Not shown any image after .dcm file select?

(All my .dcm files are n/a. These are well opened in my other dicom viewer S/W).

Maybe @ your code,

Somewhere is strange~ But there is no error message in cmd console when running.

I've resolved the "System.Reflection.Assembly.Loadfrom" error but nothing image shown up now.

And correctly linked "SimpleITKCSharpManaged.dll(1.64MB)" and "SimpleITKCSharpNative.dll(419MB)" for simpleITK 2.3.1.

Excuse me but can you check your these file size?

========================================================================

private void LoadSeriesButton_Click(object sender, RoutedEventArgs e) { CommonOpenFileDialog dialog = new CommonOpenFileDialog(); dialog.IsFolderPicker = false; dialog.Multiselect = true;

 if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
 {
     _dicomFiles = new List<DicomFile>();
     DicomFileScanner fileScanner = new DicomFileScanner();
     fileScanner.FileFound += FileScanner_FileFound;
     fileScanner.Progress += FileScanner_Progress;
     fileScanner.Complete += FileScanner_Complete;
     fileScanner.Start(dialog.FileName);
 }

}

private void FileScanner_Complete(DicomFileScanner scanner) { if (this._dicomVolume != null) { this._dicomVolume.Dispose(); } Application.Current.Dispatcher.Invoke(() => { this._dicomVolume = new DicomVolume(_dicomFiles.Select(file => new ImageData(file.Dataset))); this._maskVolume = new MaskVolume(this._dicomVolume); this.MedicalViewer.SetVolumes(this._dicomVolume, this._maskVolume); //this.d3Viewer.SetMaskVolume(maskVolume); log.Debug($"WW:{_dicomVolume.WindowWidth},WC:{_dicomVolume.WindowCenter}"); }); }

private void FileScanner_Progress(DicomFileScanner scanner, string directory, int count) { log.Debug($"{directory}, {count}"); }

private void FileScanner_FileFound(DicomFileScanner scanner, DicomFile file, string fileName) { _dicomFiles.Add(file); }

Flowergift commented 3 months ago

And same problem with my well opened ".mhd" files with ".raw" files.

Can you send me the correct your succeeded .dcm files and .mhd files with .raw data?

flowergift80@gmail.com