Giter Club home page Giter Club logo

Comments (23)

dicom avatar dicom commented on August 27, 2024

Please post the output of:

dcm.summary

from ruby-dicom.

camol avatar camol commented on August 27, 2024

System Properties:

Ruby DICOM version: 0.9.5
Byte Order (CPU): Little Endian

DICOM Object Properties:

Source: File (successfully read): /Users/camol/projects/dicom-manager/public/system/dicom_files/dicoms/000/000/001/original/IM-0001-0001.dcm
Modality: MR Image Storage
Meta Header: Yes
Value Representation: Explicit
Byte Order (File): Little Endian
Pixel Data: Yes
Image Size: 512*512
Number of frames: 1
Photometry: MONOCHROME2
Compression: JPEG 2000 Image Compression

Bits per Pixel: 16

=> ["Source: File (successfully read): /Users/camol/projects/dicom-manager/public/system/dicom_files/dicoms/000/000/001/original/IM-0001-0001.dcm", "Modality: MR Image Storage", "Meta Header: Yes", "Value Representation: Explicit", "Byte Order (File): Little Endian", "Pixel Data: Yes", "Image Size: 512*512", "Number of frames: 1", "Photometry: MONOCHROME2", "Compression: JPEG 2000 Image Compression", "Bits per Pixel: 16"]

from ruby-dicom.

dicom avatar dicom commented on August 27, 2024

This is basically a duplicate of issue #45, and a known limitation of ruby-dicom.

Unfortunately, ImageMagick (which ruby-dicom uses for handling jpeg compressed image data) is not able to decode some of the jpeg compression variants that exist.

You can verify this by trying to directly convert it using imagemagick:

convert IM-0001-0001.dcm image.jpg

I would love to be able to fix this limitation, but unfortunetaly at the moment, there are noone actively pursuing this it seems.

from ruby-dicom.

camol avatar camol commented on August 27, 2024

How to exactly try the manual conversion should it be done in irb or what?

Kamil Łęczycki
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Friday, 19 April 2013 at 14:48, Christoffer Lervåg wrote:

This is basically a duplicate of issue #45 (#45), and a known limitation of ruby-dicom.
Unfortunately, ImageMagick (which ruby-dicom uses for handling jpeg compressed image data) is not able to decode some of the jpeg compression variants that exist.
You can verify this by trying to directly convert it using imagemagick:
convert IM-0001-0001.dcm image.jpg
I would love to be able to fix this limitation, but unfortunetaly at the moment, there are noone actively pursuing this it seems.


Reply to this email directly or view it on GitHub (#49 (comment)).

from ruby-dicom.

dicom avatar dicom commented on August 27, 2024

That is done in the terminal/console/Command Prompt.
(not in irb)

from ruby-dicom.

dicom avatar dicom commented on August 27, 2024

Basically, if you can manage to get a version of ImageMagick that will successfully do this conversion, then ruby-dicom will successfully extract this image as well.

from ruby-dicom.

camol avatar camol commented on August 27, 2024

So your saying that there could be a version which will handle that and it doesn't have to be the newest one

Kamil Łęczycki
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Friday, 19 April 2013 at 14:55, Christoffer Lervåg wrote:

Basically, if you can manage to get a version of ImageMagick that will successfully do this conversion, then ruby-dicom will successfully extract this image as well.


Reply to this email directly or view it on GitHub (#49 (comment)).

from ruby-dicom.

dicom avatar dicom commented on August 27, 2024

I think I did read about it a long time ago that it should be possible to specially compile ImageMagick some way to be able to handle these images, but I have never tried it myself. Try to google imagemagick plus the error you get when you try to run:

convert IM-0001-0001.dcm image.jpg

You might find some sources.

from ruby-dicom.

camol avatar camol commented on August 27, 2024

Thx I will get you know if I figure sth

Kamil Łęczycki
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Friday, 19 April 2013 at 15:01, Christoffer Lervåg wrote:

I think I did read about it a long time ago that it should be possible to specially compile ImageMagick some way to be able to handle these images, but I have never tried it myself. Try to google imagemagick plus the error you get when you try to run:
convert IM-0001-0001.dcm image.jpg
You might find some sources.


Reply to this email directly or view it on GitHub (#49 (comment)).

from ruby-dicom.

camol avatar camol commented on August 27, 2024

I see in gemspec that ruby-dicom has rmagick and mini_magick which one of them is being exactly used to be sure which version of ImageMagic is used?

Kamil Łęczycki
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Friday, 19 April 2013 at 15:02, Kamil Łęczycki wrote:

Thx I will get you know if I figure sth

Kamil Łęczycki
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Friday, 19 April 2013 at 15:01, Christoffer Lervåg wrote:

I think I did read about it a long time ago that it should be possible to specially compile ImageMagick some way to be able to handle these images, but I have never tried it myself. Try to google imagemagick plus the error you get when you try to run:
convert IM-0001-0001.dcm image.jpg
You might find some sources.


Reply to this email directly or view it on GitHub (#49 (comment)).

from ruby-dicom.

dicom avatar dicom commented on August 27, 2024

ruby-dicom by default uses RMagick.

To check your installed ImageMagick version type:

convert -version

from ruby-dicom.

camol avatar camol commented on August 27, 2024

It seems to be rather a problem on my laptop. I begun to continue this topic http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=19420&start=15

from ruby-dicom.

camol avatar camol commented on August 27, 2024

I've finally managed to convert another dicom, but still can't convert the which started this issue for me. When I use the 'image' method on dicom object I get:

NameError: uninitialized constant Magick

from ruby-dicom.

dicom avatar dicom commented on August 27, 2024

You need to load RMagick first in your script before you call the image method on DObject:

require 'rmagick'

from ruby-dicom.

camol avatar camol commented on August 27, 2024

When I add:
require 'rmagick'
in my model. I get:
LoadError: no such file to load -- rmagick
So I added rmagick to my gemfile and then I can not even start my rails console

Kamil Łęczycki
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Monday, 6 May 2013 at 13:50, Christoffer Lervåg wrote:

You need to load RMagick first in your script before you call the image method on DObject:
require 'rmagick'


Reply to this email directly or view it on GitHub (#49 (comment)).

from ruby-dicom.

dicom avatar dicom commented on August 27, 2024

Well, you need to make sure that RMagick is properly loaded in your environment, before you can use the DObject#image method. How to achieve that however, is an RMagick/Rails issue so I can't help with that.

from ruby-dicom.

supertracer avatar supertracer commented on August 27, 2024

as instructed i am able to convert via terminal using command convert IM-0001-0001.dcm image.jpg,
but when i run it with the gem it throws error LoadError: cannot load such file -- rmagick
I have added a question on stack overflow with details here

from ruby-dicom.

dicom avatar dicom commented on August 27, 2024

@supertracer Thank you for reporting your issue.

Can you try the following in two separate irb sessions on your system:

require 'rmagick'

require 'RMagick'

Does one, both or none of these succeed?!

If the first one fails, can you please report your operating system, ruby and rmagick versions.

from ruby-dicom.

supertracer avatar supertracer commented on August 27, 2024

when i use require 'rmagick' , it doesn't even read the dcm file.
Using 'RMagick' ,reads the dcm file successfully but gives error DICOM: Decompressing pixel values has failed (unsupported transfer syntax: '1.2.840.10008.1.2.4.91' - JPEG 2000 Image Compression)
Using mini_magick, converts the dicom image to jpg, but the jpg file is not readable.

My system configurations: OS :Ubuntu 14.04,Ruby: 2.2.2p95 , RMagick: rmagick (2.13.2)

from ruby-dicom.

supertracer avatar supertracer commented on August 27, 2024

When i use include Magick , instead of DICOM.image_processor = :rmagick gives error
cannot load such file -- rmagick

from ruby-dicom.

dicom avatar dicom commented on August 27, 2024

Regarding the case sensitivity problems ('RMagick' vs 'rmagick'), you should upgrade to rmagick 2.13.4 (or later).

Regarding the failure to decompress the image data, this is usually because image magick is not able to handle the particular jpeg compression variant. However, from your case, it seems you are able to succeed with the convert command, so that makes it somewhat surprising.

I wonder if you can try this again with a newer version of rmagick, and if it still fails like this, if you can send me this dicom file.

from ruby-dicom.

supertracer avatar supertracer commented on August 27, 2024

Thanks the problem is fixed by upgrading to the newest version of RMagick

from ruby-dicom.

dicom avatar dicom commented on August 27, 2024

Im happy to hear that.

It would be great if you could post an update on the stackoverflow link above that your issue was fixed by upgrading rmagick to 2.13.4 or later.

from ruby-dicom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.