Now after the OP was updated and reveals that we are talking about the RT dose object here, I would like to come up with some additions.
This type of "image" can come in very different flavors, it may even contain no pixel data at all.
In this IOD, the Image Pixel Module is "superposed" by the RT dose module coming with a big bunch of additional attribute describing the dose values as expressed by the pixel values. Depending on what kind of pixel data replacement you are performing, their values may all become invalid.
In addition to what MrBean Bremen already wrote about generic pixel description attributes, I would recommend that you take a look at the Image Plane Module which contains information about the image geometry and the relations of images in the same frame of reference (i.e. "3D information").
Not sure if the condition for this module ("...contains grid-based doses) applies to your pixel data, but I would for sure have a look into the attributes and verify if they can be kept with their previous values, have to be updated or should be removed.
Also, look at the Frame Of Reference Module, especially the Frame Of Reference UID (0020,0052) - change it if you are not abolutely sure that the coordinates you are giving in the Image Plane Module attibutes refer to the same coordinate system as the in image that you are modifying.
Finally, an opinion-based advice: I (and probably the other posters) were assuming that you are dealing with an "ordinary image", but an RT dose object is a different beast. In terms of correctness, I think it would be easier to achieve by writing the whole object from scratch - the complexity of the matter which is fully reflected in the complexity of the Information Object Definiton makes it easy to overlook something. And the impact of wrongly encoded information on the patient is quite high in the field where these objects are used.