Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixel Array setter doesn't work #178

Closed
jrkerns opened this issue Jan 13, 2015 · 3 comments
Closed

Pixel Array setter doesn't work #178

jrkerns opened this issue Jan 13, 2015 · 3 comments

Comments

@jrkerns
Copy link
Contributor

jrkerns commented Jan 13, 2015

Setting the pixel_array attr does nothing.

See this gist for an example:
https://gist.github.com/jrkerns/eab5f5da2335572a3f0f

In the "working with pixel data" example, pixel data is modified, not replaced.

I propose a setter method for pixel_array.

@cancan101
Copy link
Contributor

I use ds.PixelData = Image.from_array(arr).tobytes()

On Tue, Jan 13, 2015, 17:30 James Kerns notifications@github.com wrote:

Setting the pixel_array attr does nothing.

See this gist for an example:
https://gist.github.com/jrkerns/eab5f5da2335572a3f0f

In the "working with pixel data" example, pixel data is modified, not
replaced.

I propose a setter method for pixel_array.


Reply to this email directly or view it on GitHub
#178.

@jrkerns
Copy link
Contributor Author

jrkerns commented Jan 13, 2015

I'm not saying it can't be done (I use numpy's .tostring() method as @darcymason shows), but behavior like this doesn't work:

new_array = np.zeros((100,100))
dcm.pixel_array = new_array
dcm.PixelData = dcm.pixel_array

You explicitly have to set it with the array:

dcm.PixelData = new_array.tostring()

@darcymason
Copy link
Member

This is a part of what I was looking at in #50. Most likely we will need a setter for pixel_array. I'm closing this issue and any discussion can carry on in #50.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants