-2

I am trying to create the 12 waves for raw ecg data. I found How to write a DICOM file from raw ecg data ,so I added all mandatory tags to my code, it adds all attributes but it does not draw the graphics.

                   Sequence waveFormSequence = attribs.ensureSequence(Tag.WaveformSequence, 1);
        Attributes waveform = new Attributes();

        waveform.setString(Tag.WaveformOriginality, VR.CS, "ORIGINAL");
        waveform.setInt(Tag.NumberOfWaveformChannels, VR.US, 12);
        waveform.setInt(Tag.NumberOfWaveformSamples, VR.UL, 15340);
        waveform.setString(Tag.SamplingFrequency, VR.DS, "500");

        Sequence channelDefinition = waveform.ensureSequence(Tag.ChannelDefinitionSequence, 12);


            Attributes att = new Attributes();

            att.setInt(Tag.WaveformChannelNumber, VR.IS, i);
            att.setString(Tag.ChannelSampleSkew, VR.DS, "0.000");
            att.setString(Tag.CodeValue, VR.SS, "");
            att.setString(Tag.CodingSchemeDesignator, VR.SS, "");
            att.setString(Tag.CodingSchemeVersion, VR.SS, "");
            att.setInt(Tag.WaveformBitsStored, VR.US, 8);

            Sequence channelSource = att.ensureSequence(Tag.ChannelSourceSequence, 1);

            Attributes channelSourceAtts = new Attributes();
            channelSourceAtts.setString(Tag.CodeMeaning, VR.LO, "Heart");// 1
            channelSource.add(channelSourceAtts);

            att.setValue(Tag.ChannelSourceSequence, VR.SQ, channelSource);

            channelDefinition.add(att);


        waveform.setValue(Tag.ChannelDefinitionSequence, VR.SQ, channelDefinition);

        waveform.setInt(Tag.WaveformBitsAllocated, VR.US, 8);
        waveform.setString(Tag.WaveformSampleInterpretation, VR.SS, "8");
celia
  • 67
  • 9
  • The code you posted shows the setting of the meta-attributes of the waveform. But it does not show how you set the waveform values themselves (5400,1010) Waveform Data. Maybe this is the problem? – Markus Sabin Aug 19 '19 at 08:49
  • No, I do it correctly, but I did not posted it – celia Aug 19 '19 at 12:41

1 Answers1

-3

Maybe I missed something, but drawing the ECG leads has to be done by the DICOM Viewer. Not every DICOM Viewer is able to display ECG. Most of the free viewers can only handle DICOM images (ECG is not an image, it's a waveform).

Daniel
  • 1