|
From: Suares T. T. <ta...@bw...> - 2012-05-24 16:03:37
|
Mathieu, thanks a lot for this quick answer and advice. That was very helpful. You were right. I just tried with a 8bits image and there is no difference. I was trying with a 16bits image before. So the issue was related to image bitness. I know JAI does provide a reader and writer to handle JPEGLS (* CLibJPEGImageReader*, *CLibJPEGImageWriter*), which are used in combination with some generated DLLs and additional jar-library (*clibwrapper_jiio.jar*). The problem is, those DLLs are generated and work with windows 32-bit JRE only. So, windows 64bit machine may handle JPEGLS using 32-bit JRE, but that is not possible with 64-bit JRE on Windows. And it looks like they is no way build JAI source code using 64-bit JRE in order to generate windows 64-bit DLLs. That is why I am trying to switch to gdcm. Or do you think they may be a way to handle JPEGLS on windows 64-bit machine with JAI using 64-bit JRE? Maybe I am missing something. Any way thanks again for those details. Regards, Suares On Thu, May 24, 2012 at 10:05 AM, Mathieu Malaterre < mat...@gm...> wrote: > Hi Suares, > > On Thu, May 24, 2012 at 3:39 PM, Suares Tamekue Tatuebu > <ta...@bw...> wrote: > > this is Suares from SPL Harvard and BWH Boston. > > > > I saw you were involved in most of gdcm related documents I found in > > Internet. So I thought you might be the right person to address my > question > > to and was hoping would have time to answer. > > Well, the FAQ refers to the mailing list instead for this type of queries. > > > I am trying to de-identify Dicom image by changing the pixel data using > java > > (commonly called pixed de-identification). My concern is specialy > related to > > JPEG Lossless which is not supported by the JAI on 64-bit Systems. So, I > was > > thinking gdcm might be the right tool to solve the problem. > > I believe JAI+JPEGLS on 64bits system do work, they simply produce > improper files. > > > Basically I am trying to get a WritableRaster from the original image in > > order to modify a certain region. Then I will use this to rebuild a > > modified image. > > > > I know I can get the image via the reader. I mean something like this: > > > > ImageReader reader = new ImageReader(); > > > > reader.SetFileName(originalFilename); > > > > reader.Read(); > > > > Image image = reader.GetImage(); > > > > So my question is: what is the best way to get a writableRaster for this > > image object? The example ScanDirectory.java very hepfull sofar. I see > the > > writableRaster is accessed via a created bufferedImage. But it looks like > > the original image is being modified somehow maybe through assigning the > > Photometric Interpration or conversion of the image (bitmap) into Byte or > > short array. The built buffered image actually appears darker than > before. > > No the image buffer is carefully passed from C++ to Java. Not a single > byte is being touched. > My guess is that you are viewing an unsigned 16bits image directly as > if it was 8bits. You may need to rescale the scalar range to please > whatever rendering engine you are using. > To convince yourself play with 8bits data. > > HTH > -- > Mathieu > |