我想將數字化ecg數據轉換爲dicom文件。我的代碼如下所示清除Canvas如何將數字化ECG數據轉換爲dicom文件
DateTime today = DateTime.Today;
DicomFile dicomFile = new DicomFile();
dicomFile.TransferSyntax = TransferSyntax.ExplicitVrLittleEndian;
dicomFile.DataSet[DicomTags.StudyDate].SetStringValue(today.ToString("yyyyMMdd"));
dicomFile.DataSet[DicomTags.StudyTime].SetStringValue(today.ToString("HHmmss"));
dicomFile.DataSet[DicomTags.PatientsBirthName].SetStringValue(patientName);
dicomFile.DataSet[DicomTags.PatientId].SetStringValue(patientId);
dicomFile.DataSet[DicomTags.StudyInstanceUid].SetStringValue(studyId);
dicomFile.DataSet[DicomTags.SeriesInstanceUid].SetStringValue(seriesId);
dicomFile.DataSet[DicomTags.Modality].SetStringValue(modality);
dicomFile.DataSet[DicomTags.ConversionType].SetStringValue(conversionType);//Drawing
string sopInstanceUid = DicomUid.GenerateUid().UID; // Should be unique for each image
this.pacsAccessionNumber = (Functions.GetRandomString() + Functions.GetRandomString()).Substring(0, 16);
dicomFile.DataSet[DicomTags.InstanceNumber].SetInt32(0, instanceNumber);//Series Instance Number
dicomFile.DataSet[DicomTags.SopClassUid].SetStringValue(SopClass.Sop12LeadEcgWaveformStorage.Uid);
dicomFile.DataSet[DicomTags.SopInstanceUid].SetStringValue(sopInstanceUid);
dicomFile.DataSet[DicomTags.AccessionNumber].SetStringValue(this.pacsAccessionNumber);
dicomFile.MediaStorageSopClassUid = SopClass.Sop12LeadEcgWaveformStorage.Uid;
dicomFile.MediaStorageSopInstanceUid = sopInstanceUid;
dicomFile.DataSet[DicomTags.Manufacturer].SetStringValue("MITS");// Manufacturer Name
DicomSequenceItem waveFormSeq = new DicomSequenceItem();
waveFormSeq[DicomTags.WaveformOriginality].SetStringValue("DERIVED");// Other option is ORIGINAL
waveFormSeq[DicomTags.WaveformChannelNumber].SetUInt32(0, 1);//must be between 1-13
waveFormSeq[DicomTags.NumberOfWaveformSamples].Values = samplingCount;//NumberOfWaveformSamples -- max value is 16384
waveFormSeq[DicomTags.SamplingFrequency].SetFloat32(0, 1000);//frequency(must be dynamic) -- must be dynamic must be between 200-100
waveFormSeq[DicomTags.WaveformSampleInterpretation].SetStringValue("SS");//signed
waveFormSeq[DicomTags.WaveformBitsAllocated].SetInt32(0, 16);//16 bit
waveFormSeq[DicomTags.WaveformData].Values = voltageValues;
DicomSequenceItem channelSeq = new DicomSequenceItem();
channelSeq[DicomTags.ChannelSensitivityCorrectionFactor].SetUInt32(0, 1);
channelSeq[DicomTags.ChannelBaseline].SetUInt32(0, 0);
channelSeq[DicomTags.ChannelTimeSkew].SetUInt32(0, 0);
DicomSequenceItem channelSourceSeq = new DicomSequenceItem();
channelSourceSeq[DicomTags.CodeValue].SetStringValue("5.6.3-9-1");
channelSourceSeq[DicomTags.CodingSchemeDesignator].SetStringValue("SCPECG");
channelSourceSeq[DicomTags.CodingSchemeVersion].SetStringValue("1.3");
channelSeq[DicomTags.ChannelSourceSequence].AddSequenceItem(channelSourceSeq);
DicomSequenceItem channelSensUnitSeq = new DicomSequenceItem();
channelSensUnitSeq[DicomTags.CodeValue].SetStringValue("uV");
channelSensUnitSeq[DicomTags.CodingSchemeDesignator].SetStringValue("UCUM");
channelSensUnitSeq[DicomTags.CodingSchemeVersion].SetStringValue("1.4");
channelSeq[DicomTags.ChannelSensitivityUnitsSequence].AddSequenceItem(channelSensUnitSeq);
waveFormSeq[DicomTags.ChannelSequence].AddSequenceItem(channelSeq);
dicomFile.DataSet[DicomTags.WaveformSequence].AddSequenceItem(waveFormSeq);
SendFile(dicomFile);
但是在pacs服務器中,我無法打開dcm文件。
有沒有......我失蹤了?
的DICOM文件http://www.ikincidoktor.com/NonDicomRepository/8/testecg.dcm
PACS系統是否實際支持波形sop類?你是否能夠使用Clunie的像素化查看器打開結果文件:http://www.pixelmed.com/index.html#PixelMedJavaDICOMToolkit – 2015-03-07 13:30:52
我正在使用EcgViewer應用程序來檢查數據。它說「沒有得到信號」。但我把數字化的心電圖放在正確的標籤上。哪裏可以是錯誤? @BrettOkken – 2015-03-09 13:32:45
這是文件:http://www.ikincidoktor.com/NonDicomRepository/8/testecg。dcm – 2015-03-09 14:23:53