Discussion:
[ITK-users] simple ITK C# show image
an qin
2017-05-05 16:22:55 UTC
Permalink
Hi, I am new to C# simpleITK and can't find much sample codes. I tried to
read dicom image and display them in simpleITK. The dicom image was read
without a problem. But got an exception when show.

Any suggestion will be appreciated.

Thanks.
Andy


//-------------code------------
using itk.simple;

namespace TestReadDicom
{
class Program
{
static void Main(string[] args)
{
var myreader = new ImageSeriesReader();
var names =
ImageSeriesReader.GetGDCMSeriesFileNames(@"E:\ImageSet_0.DICOM");
myreader.SetFileNames(names);
var image = myreader.Execute();
VectorDouble imDim = image.GetOrigin();
Console.WriteLine(imDim[0].ToString());
SimpleITK.Show(image);
}
}
}

//-------------output------------
Additional information: Exception thrown in SimpleITK Show:
..\..\..\..\..\SimpleITK\Code\IO\src\sitkShow.cxx:500:

sitk::ERROR: Error in administrating child process: [The parameter is
incorrect
Lowekamp, Bradley (NIH/NLM/LHC) [C]
2017-05-05 17:11:47 UTC
Permalink
Hello,

The documentation for the sitk::Show method can be found here:
https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#ac8416e6e7f02dedfe8373b83dbea411d

I suspect that you don’t have Fiji/ImageJ installed, or the method was not able to locate the executable. There are some environment variables that can be set to properly configure it.

The Show method is designed to be a convenience method to launch an external viewer to display data. It is convenient to use in interactive environments such as python or R for a quick display.

SimpleITK provides wrapping for a large number of languages include Python, R, Lua, Tcl, Ruby, Java and C#. Some languages have more examples then others. In general it’s not too hard to figure out how to translate an useful example from one language to another.

You can find a list of basic examples here:

https://itk.org/SimpleITKDoxygen/html/examples.html

And may Python and R notebooks here:

https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks

Hope that helps,
Brad

On May 5, 2017, at 12:22 PM, an qin <***@gmail.com<mailto:***@gmail.com>> wrote:

Hi, I am new to C# simpleITK and can't find much sample codes. I tried to read dicom image and display them in simpleITK. The dicom image was read without a problem. But got an exception when show.

Any suggestion will be appreciated.

Thanks.
Andy


//-------------code------------
using itk.simple;

namespace TestReadDicom
{
class Program
{
static void Main(string[] args)
{
var myreader = new ImageSeriesReader();
var names = ImageSeriesReader.GetGDCMSeriesFileNames(@"E:\ImageSet_0.DICOM");
myreader.SetFileNames(names);
var image = myreader.Execute();
VectorDouble imDim = image.GetOrigin();
Console.WriteLine(imDim[0].ToString());
SimpleITK.Show(image);
}
}
}

//-------------output------------
Additional information: Exception thrown in SimpleITK Show: ..\..\..\..\..\SimpleITK\Code\IO\src\sitkShow.cxx:500:

sitk::ERROR: Error in administrating child process: [The parameter is incorrect
_____________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
_______________________________________________
Community mailing list
***@itk.org
http://public.kitware.com/mailman/listinfo/community
an qin
2017-05-05 17:35:26 UTC
Permalink
Brad, Thank you so much. Yes, I do not have Fiji/ImageJ installed. --Andy

On Fri, May 5, 2017 at 1:11 PM, Lowekamp, Bradley (NIH/NLM/LHC) [C] <
Post by Lowekamp, Bradley (NIH/NLM/LHC) [C]
Hello,
https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#
ac8416e6e7f02dedfe8373b83dbea411d
I suspect that you don’t have Fiji/ImageJ installed, or the method was not
able to locate the executable. There are some environment variables that
can be set to properly configure it.
The Show method is designed to be a convenience method to launch an
external viewer to display data. It is convenient to use in interactive
environments such as python or R for a quick display.
SimpleITK provides wrapping for a large number of languages include
Python, R, Lua, Tcl, Ruby, Java and C#. Some languages have more examples
then others. In general it’s not too hard to figure out how to translate an
useful example from one language to another.
https://itk.org/SimpleITKDoxygen/html/examples.html
https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks
Hope that helps,
Brad
Hi, I am new to C# simpleITK and can't find much sample codes. I tried to
read dicom image and display them in simpleITK. The dicom image was read
without a problem. But got an exception when show.
Any suggestion will be appreciated.
Thanks.
Andy
//-------------code------------
using itk.simple;
namespace TestReadDicom
{
class Program
{
static void Main(string[] args)
{
var myreader = new ImageSeriesReader();
ImageSet_0.DICOM");
myreader.SetFileNames(names);
var image = myreader.Execute();
VectorDouble imDim = image.GetOrigin();
Console.WriteLine(imDim[0].ToString());
SimpleITK.Show(image);
}
}
}
//-------------output------------
sitk::ERROR: Error in administrating child process: [The parameter is incorrect
_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.kitware.com/products/protraining.php
http://www.itk.org/Wiki/ITK_FAQ
http://public.kitware.com/mailman/listinfo/insight-users
_______________________________________________
Community mailing list
http://public.kitware.com/mailman/listinfo/community
Loading...