Thanks for the clarification. The file in question is in deed implicit VR. There is not a LargestImagePixelValue in RT Dose. Our TPS (Eclipse) imports files with DoseType=ERROR just fine. It does, however, reject RT Dose files with PixelRepresentation = 1. I disagree with your suggestion of changing the type of pixel_array. It should be unsigned, negative values (signs) are handled by the HighBit when PixelRepresentation = 1. I tested in MATLAB and it handles it correctly. As does pydicom. These steps will demonstrate it:
ds = dicom.read_file(filename)
dose = ds.pixel_array * float(ds.DoseGridScaling)
dose[i,j,k] = -dose[i,j,k]
ds.PixelRepresentation = 1
ds.PixelData = (dose/float(ds.DoseGridScaling)).astype('uint32').tostring()
ds.save_as(newfile)
ds = dicom.read_file(newfile)
dose = ds.pixel_array * float(ds.DoseGridScaling)
dose[i,j,k]
A negative value should be returned here.
If PixelRepresentation is set to 0, a positive (large) number will be returned.
It appears as the problem lies with the TPS. A sidenote is that pydicom allows PixelRepresentation to equal 1 even if DoseType is Physical, which it should not according to my understanding of the DICOM standard.