Hi, I'm a first time user of ImageMagick. I've read only several threads that it is possible to read dicom files and defineSet() must be used.
How should I fill in defineSet? It says the type, key, flag.
so should it be? My issue is what should xx, yy, zz values should be?
Image image;
image.defineSet(xx,yy,zz);
Image.read("test.dcm);
Reading DICOM for first time users
-
- Posts: 4
- Joined: 2018-04-11T10:01:39-07:00
- Authentication code: 1152
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Reading DICOM for first time users
Perhaps see the DCM entry at http://www.imagemagick.org/script/formats.php
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Reading DICOM for first time users
Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
For novices, see
http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
Are you using the command line or API? If the latter which one?
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
For novices, see
http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
Are you using the command line or API? If the latter which one?
-
- Posts: 4
- Joined: 2018-04-11T10:01:39-07:00
- Authentication code: 1152
Re: Reading DICOM for first time users
Hi,
My IM version is ImageMagick-7.0.7-Q16. I'm implementing Magick++ in Visual Studio 2017 (C++). The code i've been trying to execute is below; However i've read threads that defineSet(). Appreciate any help for novices like me. Thanks.
My IM version is ImageMagick-7.0.7-Q16. I'm implementing Magick++ in Visual Studio 2017 (C++). The code i've been trying to execute is below; However i've read threads that defineSet(). Appreciate any help for novices like me. Thanks.
Code: Select all
#include <Magick++.h>
using namespace std;
using namespace Magick;
int main(int argc,char **argv)
{
// Read image file from disk
Image image( "DCM0000.dcm" );
return 0;
}
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Reading DICOM for first time users
Where have you read this?JoelThan89 wrote:However i've read threads that defineSet().
After reading the image, have you tried writing it to another format, eg PNG?
snibgo's IM pages: im.snibgo.com
-
- Posts: 4
- Joined: 2018-04-11T10:01:39-07:00
- Authentication code: 1152
Re: Reading DICOM for first time users
When trying to read i've got an error.
code
error
I think the problem is memory related?
The defineSet() mentioned was from an old post below
code
Code: Select all
#include <Magick++.h>
#include <iostream>
using namespace std;
using namespace Magick;
int main(int argc, char **argv)
{
// Initialise ImageMagick library
InitializeMagick(*argv);
Image image("DCM0000.dcm");
return 0;
}
Code: Select all
Unhandled exception at 0x000007FEFD2CA06D in Project6.exe: Microsoft C++ exception: Magick::ErrorCorruptImage at memory location 0x00000000001BF070.
The defineSet() mentioned was from an old post below
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Reading DICOM for first time users
I suggest you catch exceptions within your program. Otherwise, we can only guess what the problem is. There are loads of examples in the source distribution -- see "try" and "catch".
I can read a DCM file with no problems in a Magick++ program, with no defines.
I can read a DCM file with no problems in a Magick++ program, with no defines.
snibgo's IM pages: im.snibgo.com
-
- Posts: 4
- Joined: 2018-04-11T10:01:39-07:00
- Authentication code: 1152
Re: Reading DICOM for first time users
Hi everyone, i've just realised my dicom file is corrupted and now works with another dicom file. Thanks for the help everyone