Ask Your Question
0

What is the way to obtain "PixelData" through dcm4che from a DIOCM file?

asked 2021-09-14 11:00:00 +0000

qstack gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-06-19 11:00:00 +0000

pufferfish gravatar image

To obtain the "PixelData" from a DICOM file using dcm4che, you can use the following code:

File file = new File("path_of_dicom_file");
DicomObject dcmObj = DicomObject.readFile(file);
if (dcmObj.contains(Tag.PixelData)) {
    byte[] pixelData = dcmObj.getBytes(Tag.PixelData);
    // Process byte array
}

In the above code, the DicomObject class is used to read the DICOM file's metadata and pixel data. The contains method is used to check if the DICOM object contains the "PixelData" tag, and the getBytes method is used to obtain the byte array of pixel data.

Once you have obtained the byte array of pixel data, you can process it according to your needs. For example, you can convert it to an image using an image processing library.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-09-14 11:00:00 +0000

Seen: 13 times

Last updated: Jun 19 '21