Dear All ,
i rebuild GDCM,and vtkgdcm using cmake

but when use the output dlls , I get the following error

The type initializer for 'vtkgdcm.vtkgdcmPINVOKE' threw an exception.

I want to read the Dicom data and use vtk for further visualization any suggestion please

the code is :

try
{
gdcm.FilenamesType l;
vtkgdcm.vtkGDCMImageReader reader = new vtkgdcm.vtkGDCMImageReader(); // this is the source of the error


gdcm.Directory d = new gdcm.Directory();
d.Load(@"E:\Master Degree\test DataSet\Asmaa_pre\08151449");
l = d.GetFilenames();
int nfiles = l.Count;
vtkStringArray sarray = vtkStringArray.New();
for (int i = 0; i < nfiles; ++i)
{
sarray.InsertNextValue(l[i]);
}
Debug.Assert(sarray.GetNumberOfValues() == (int)nfiles);
reader.SetFileNames(sarray);
sarray.Dispose();


Console.WriteLine("Load success");
Console.ReadLine();
}
catch(Exception e )
{
Console.WriteLine(e.Message);
Console.ReadLine();


}

Best regards