public class DecompressPixmap
{
public static void main(String[] args) throws Exception
{
String file1 = args[0];
String file2 = args[1];
PixmapReader reader = new PixmapReader();
reader.SetFileName( file1 );
boolean ret = reader.Read();
if( !ret )
{
throw new Exception("Could not read: " + file1 );
}
ImageChangeTransferSyntax change = new ImageChangeTransferSyntax();
change.SetTransferSyntax( new TransferSyntax(TransferSyntax.TSType.ImplicitVRLittleEndian) );
PixmapToPixmapFilter filter = (PixmapToPixmapFilter)change;
filter.SetInput( reader.GetPixmap() );
if( !change.Change() )
{
throw new Exception("Could not change: " + file1 );
}
Pixmap p = change.GetOutputAsPixmap();
FileMetaInformation.SetSourceApplicationEntityTitle( "Just For Fun" );
PixmapWriter writer = new PixmapWriter();
writer.SetFileName( file2 );
writer.SetFile( reader.GetFile() );
writer.SetImage( p );
ret = writer.Write();
if( !ret )
{
throw new Exception("Could not write: " + file2 );
}
}
}