public class DicomException : LeadtoolsException Public Class DicomExceptionInherits LeadtoolsExceptionImplements System.Runtime.InteropServices._Exception, System.Runtime.Serialization.ISerializable
public class DicomException extends LeadtoolsException public ref class DicomException : public LeadtoolsException, System.Runtime.InteropServices._Exception, System.Runtime.Serialization.ISerializable using Leadtools;using Leadtools.Dicom;public void TestLoadDicomDataset(){string dicomFileName = Path.Combine(LEAD_VARS.ImagesDir, "SomeBadFileName.dcm");//Make sure to initialize the DICOM engine, this needs to be done only once//In the whole applicationDicomEngine.Startup();using (DicomDataSet ds = new DicomDataSet()){try{ds.Load(dicomFileName, DicomDataSetLoadFlags.None);}catch (DicomException ex){//LEADTOOLS Dicom Error (the file can't be opened)if (ex.Code == DicomExceptionCode.Open)Console.WriteLine(string.Format("File {0} can't be opened", dicomFileName));else{//Some other LEADTOOLS Dicom ErrorConsole.WriteLine(string.Format("Could not load the file {0}.{1}Dicom error code: {2}{1}Message: {3}", dicomFileName, Environment.NewLine, ex.Code, ex.Message));}}catch (Exception ex){// Other errorsConsole.WriteLine(string.Format("Could not load the file {0}.{1}{2}", dicomFileName, Environment.NewLine, ex.Message));}}DicomEngine.Shutdown();}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS21\Resources\Images";}
Imports LeadtoolsImports Leadtools.DicomPrivate Sub TestLoadDicomDataset()Dim dicomFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "SomeBadFileName.dcm")'Make sure to initialize the DICOM engine, this needs to be done only once'In the whole applicationDicomEngine.Startup()Dim ds As DicomDataSet = New DicomDataSet()Using (ds)Tryds.Load(dicomFileName, DicomDataSetLoadFlags.None)Catch ex As DicomException'LEADTOOLS Dicom Error (the file can't be opened)If ex.Code = DicomExceptionCode.Open ThenMessageBox.Show(String.Format("File {0} can't be opened", dicomFileName))Else'Some other LEADTOOLS Dicom ErrorMessageBox.Show(String.Format("Could not load the file {0}.{1}Dicom error code: {2}{1}Message: {3}", dicomFileName,Environment.NewLine, ex.Code, ex.Message))End IfCatch ex As Exception' Other errorsMessageBox.Show(String.Format("Could not load the file {0}.{1}{2}", dicomFileName, Environment.NewLine, ex.Message))End TryEnd UsingDicomEngine.Shutdown()End SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\LEADTOOLS21\Resources\Images"End Class
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
