These are chat archives for numpy/numpy

1st
Jun 2017
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:16
hi folks i have a stack overflow type of questsion
*question
i keep getting this traceback on broadcasting in jupyter notebook

ValueError Traceback (most recent call last)

<ipython-input-37-299ff6b5c95c> in <module>()
7 ds = dicom.read_file(filenameDCM)
8 # store the raw image data
----> 9 ArrayDicom[:, :, lstFilesDCM.index(filenameDCM)] = ds.pixel_array

ValueError: could not broadcast input array from shape (128,128) into shape (256,256)

and this is my code ``# The array is sized based on 'ConstPixelDims'
ArrayDicom = numpy.zeros(ConstPixelDims, dtype=RefDs.pixel_array.dtype)

loop through all the DICOM files

for filenameDCM in lstFilesDCM:

# read the file
ds = dicom.read_file(filenameDCM)
# store the raw image data
ArrayDicom[:, :, lstFilesDCM.index(filenameDCM)] = ds.pixel_array  ``

sorry this was the error again ``---------------------------------------------------------------------------
ValueError Traceback (most recent call last)

<ipython-input-37-299ff6b5c95c> in <module>()
7 ds = dicom.read_file(filenameDCM)
8 # store the raw image data
----> 9 ArrayDicom[:, :, lstFilesDCM.index(filenameDCM)] = ds.pixel_array

ValueError: could not broadcast input array from shape (128,128) into shape (256,256)
``

working with dicom (MRI , medical data) and workin VTK and stuff in augmented reality, but just doing the basic format conversion is a pain in the ass before even VTK
i put in my own dicom data from other open source NIH datasets and this is literally at the end of the code tutorial im following (so i can just spend more time dev'in in AR in C#), so this is the 'boring' part in data processing i have to do that i need some help with
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:23
wait
BigColombian
@BigColombian
Jun 01 2017 17:02
.
^ Oops. I did not mean to type that.