0

我正在使用 GDCM 读取 DICOM 文件。由于该项目使用 C#,因此我按照 GDCM 的手册使用 SWIG 编译了 GDCM 的 C# 包装。

现在我正在尝试将文件夹中的所有 DICOM 排序到 Volumes 中(很像GDCM 提供的VolumeSorter 示例,但是,这是用 C++ 编写的)。我正在关注SortImage2.cs示例,但这不会编译,给我错误:

错误 CS1503 参数 1:无法从“方法组”转换为“SWIGTYPE_p_f_r_q_const__gdcm__DataSet_r_q_const__gdcm__DataSet__bool”新 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;
    }
}

我假设它无法解释 Is there a way to "cast" the method to the expected type? 或者这是 GDCM 设置 SWIG 的错误?

4

1 回答 1

0

您描述的示例实际上已被注释掉,如下所示:

我怀疑这是一个从未完成的功能。

于 2015-11-23T08:33:55.463 回答