Skip to content

Commit

Permalink
Edit test to ensure we can now write Pixel Data with OB VR
Browse files Browse the repository at this point in the history
  • Loading branch information
lnogueir committed May 27, 2024
1 parent 808f3ba commit 1a006d1
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import (
"os"
"testing"

"github.com/suyashkumar/dicom/pkg/vrraw"

"github.com/suyashkumar/dicom/pkg/frame"
"github.com/suyashkumar/dicom/pkg/vrraw"

"github.com/google/go-cmp/cmp/cmpopts"

Expand Down Expand Up @@ -400,17 +399,23 @@ func TestWrite(t *testing.T) {
dataset: Dataset{Elements: []*Element{
mustNewElement(tag.MediaStorageSOPClassUID, []string{"1.2.840.10008.5.1.4.1.1.1.2"}),
mustNewElement(tag.MediaStorageSOPInstanceUID, []string{"1.2.3.4.5.6.7"}),
mustNewElement(tag.TransferSyntaxUID, []string{uid.ImplicitVRLittleEndian}),
mustNewElement(tag.TransferSyntaxUID, []string{uid.ExplicitVRLittleEndian}),
mustNewElement(tag.BitsAllocated, []int{8}),
setUndefinedLength(mustNewElement(tag.PixelData, PixelDataInfo{
IsEncapsulated: true,
Frames: []*frame.Frame{
{
Encapsulated: true,
EncapsulatedData: frame.EncapsulatedFrame{Data: []byte{1, 2, 3, 4}},
setUndefinedLength(&Element{
Tag: tag.PixelData,
ValueRepresentation: tag.VRPixelData,
// Encapsulated should always have OB VR, but mustNewElement would make it OW.
RawValueRepresentation: "OB",
Value: mustNewValue(PixelDataInfo{
IsEncapsulated: true,
Frames: []*frame.Frame{
{
Encapsulated: true,
EncapsulatedData: frame.EncapsulatedFrame{Data: []byte{1, 2, 3, 4}},
},
},
},
})),
}),
}),
mustNewElement(tag.FloatingPointValue, []float64{128.10}),
mustNewElement(tag.DimensionIndexPointer, []int{32, 36950}),
}},
Expand Down

0 comments on commit 1a006d1

Please sign in to comment.