Can any one please help me in compression of DICOM(.dcm) image file.
I am able to do it by using GZipStrim a class of using System.IO.Compression namespace which gives upto 50% compression and i want upto 80% compression. It may be possible by using lossy compression but i don't know how to do it?
please help me out how can i achieve it...?
What I have tried:
string sFiles = Directory.GetFiles(sInDir, "*.DCM*", SearchOption.AllDirectories);
int iDirLen = sInDir[sInDir.Length - 1] == Path.DirectorySeparatorChar ? sInDir.Length : sInDir.Length + 1;
using (FileStream outFile = new FileStream(sOutFile, FileMode.Create, FileAccess.Write, FileShare.ReadWrite))
using (GZipStream str = new GZipStream(outFile, CompressionLevel.Optimal,true))
foreach (string sFilePath in sFiles)
string sRelativePath = sFilePath.Substring(iDirLen);
if (progress != null)
CompressFile(sInDir, sRelativePath, str);
it is giving me 50% compression but wants to compress uoto 80%.