0
我正在使用GDCM讀取DICOM文件。由於該項目採用C#,因此遵循GDCM手冊,我已使用SWIG編譯了GDCM的C#包裝。C#GDCM函數指針,無法轉換爲SWIGTYPE
現在我正在嘗試將文件夾中的所有DICOM分類爲卷(很像GDCM提供的VolumeSorter example,但是,這是用C++編寫的)。我正在關注的SortImage2.cs例子,但是這不會編譯,給我的錯誤:
Error CS1503 Argument 1: cannot convert from 'method group' to 'SWIGTYPE_p_f_r_q_const__gdcm__DataSet_r_q_const__gdcm__DataSet__bool' New Unity Project.CSharp ...\Scripts\SortImage2.cs 33
下面是完整的例子:
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
using System;
using gdcm;
public class SortImage2
{
bool mysort(DataSet ds1, DataSet ds2)
{
return false;
}
public static int Main(string[] args)
{
Sorter sorter = new Sorter();
sorter.SetSortFunction(mysort);
return 0;
}
}
我假設它不能解釋 是否有一種將方法「投射」到預期類型的方法?或者這是GDCM設置SWIG時的錯誤?
謝謝。這並不能解決我的問題,但至少現在我知道真正的問題是什麼。也許有人可以刪除這些例子,然後呢?我沒有考慮查看CMakeLists,看看這個例子是否真的被創建 - 因爲它在源代碼中,我認爲它會被使用。 對於任何需要沿着這些線條的東西的人來說,它看起來像SimpleITK C#界面提供了比直接使用GDCM-Sharp更多的這些功能。 – Germanunkol