本文介绍了使用有损技术的Dicom图像压缩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮我压缩DICOM(.dcm)图像文件。

我能够通过使用GZipStrim一类使用System.IO.Compression命名空间来实现它50%压缩,我想要高达80%的压缩。有可能通过使用有损压缩,但我不知道该怎么做?



请帮帮我,我怎样才能实现它??



我是什么尝试过:



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))

使用(GZipStream str = new GZipStream(outFile,CompressionLevel.Optimal,true))





foreach( sFiles中的字符串sFilePath)

{

string sRelativePath = sFilePath.Substring(iDirLen);

if(progress!= null)

进度(sRelativePath);

CompressFile(sInDir,sRelativePath,str);

}



它给了我50%的压缩但是想压缩uoto 80%。

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)
progress(sRelativePath);
CompressFile(sInDir, sRelativePath, str);
}

it is giving me 50% compression but wants to compress uoto 80%.

推荐答案


这篇关于使用有损技术的Dicom图像压缩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 18:31