Conversion from JPEG2000 to JPEG-LS
Moderator: Moderator Team
Conversion from JPEG2000 to JPEG-LS
Hi,
I need to convert from JPEG2000 to JPEG-LS.
The operation fails because "canWriteXfer" return "false".
Debugging the code I see this is because both the tx syntax are encapsulated.
What's the best way to perform this conversion?
Does is exist something to decompress original file (JPEG2000) "on the fly" before translating to JPEG-LS?
Thank you
I need to convert from JPEG2000 to JPEG-LS.
The operation fails because "canWriteXfer" return "false".
Debugging the code I see this is because both the tx syntax are encapsulated.
What's the best way to perform this conversion?
Does is exist something to decompress original file (JPEG2000) "on the fly" before translating to JPEG-LS?
Thank you
-
- DCMTK Developer
- Posts: 2549
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
JPEG 2000 decompression is not part of the freely available DCMTK but has to be licensed separately.Does is exist something to decompress original file (JPEG2000) "on the fly" before translating to JPEG-LS?
-
- DCMTK Developer
- Posts: 2549
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
-
- DCMTK Developer
- Posts: 2549
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
You can find sample code in the documentation. The compression/decompression is performed by the call to chooseRepresentation(). There's no need to save the DICOM object to a file.
I use the following code:
// Temporary decompress original file
eTxSyntax = EXS_LittleEndianExplicit;
pDataset->chooseRepresentation(eTxSyntax, NULL);
if (!pDataset->canWriteXfer(eTxSyntax)) // Decompression failed?
{
return FALSE;
}
Debugging the application the pDataset tx syntax remains EXS_JPEG2000LosslessOnly before and after "chooseRepresentation" call.
What I'm missing?
// Temporary decompress original file
eTxSyntax = EXS_LittleEndianExplicit;
pDataset->chooseRepresentation(eTxSyntax, NULL);
if (!pDataset->canWriteXfer(eTxSyntax)) // Decompression failed?
{
return FALSE;
}
Debugging the application the pDataset tx syntax remains EXS_JPEG2000LosslessOnly before and after "chooseRepresentation" call.
What I'm missing?
-
- DCMTK Developer
- Posts: 2549
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Yes all registered correctly.
I'm able to compress/decompress from non-encapsulated to encapsulated and vice-versa.
I'm looking for a workaround to convert from encapsulated to encapsulated by decompressing to EVRLE on the fly.
Adding my previous piece of code I think the decompression in memory succeded (the memory grows) but the next step to compress again fails.
I'm able to compress/decompress from non-encapsulated to encapsulated and vice-versa.
I'm looking for a workaround to convert from encapsulated to encapsulated by decompressing to EVRLE on the fly.
Adding my previous piece of code I think the decompression in memory succeded (the memory grows) but the next step to compress again fails.
-
- DCMTK Developer
- Posts: 2549
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Who is online
Users browsing this forum: No registered users and 1 guest