Recent content by ProPatto16

  1. P

    Python How to Efficiently Remove Zeros from 2D Arrays in Python?

    I gave up on that and it works fine in like 5 lines of code with basic indexing. For anyone that's interested ... Using numpy.nonzero on a middle row and column can get the indexes of where the zeros start and stop and can convert to array and use min() max() to get the first and last indexes...
  2. P

    Python How to Efficiently Remove Zeros from 2D Arrays in Python?

    My understanding of while loops is that as soon as the condition is false it should terminate. I.e. The false condition is the exit. The condition tests the first row and if it returns True then deletes it. So it's always checking the first row but each time it's a new first row.
  3. P

    Python How to Efficiently Remove Zeros from 2D Arrays in Python?

    when i do it with while loops i have while numpy.all(array[0]==0)==True: Calarray=numpy.delete(array,0,0) so it checks each line and if its all zeros then it deletes that line. But it doesn't terminate unless i manually press return. If i run the while condition prior to executing i get...
  4. P

    Python How to Efficiently Remove Zeros from 2D Arrays in Python?

    Is there a simple way to delete empty elements from a 2d array where you don't have to iterate every row or column?
  5. P

    Python How to Efficiently Remove Zeros from 2D Arrays in Python?

    Hi there, I have 1024,1024 arrays (lots of them) which are really roughly 600,800 (it changes) and then buffered by zeros all the way around something like 000000000000000000 000000000000000000 000xxxxxxxxxxxxx000 000xxxxxxxxxxxxx000 000xxxxxxxxxxxxx000 000000000000000000 000000000000000000 i...
  6. P

    Spatial Filtering 2d numpy array with a 3x3 mask

    Hey, thanks, that will help.. just out of curiosity... does the ndimage.convolve method from scipy do the filtering in the same way? that would make it a one liner...
  7. P

    Spatial Filtering 2d numpy array with a 3x3 mask

    I have large 2d matrices from dicom files that i wish to filter with a 3x3 mask. the image arrays are of varying size and are padded with one border of zeros for the edge handling of the mask. i need to iterate over every element in the array and multiply it by the mask. I've done it in SciLab...
  8. P

    Stop warping of photosensitive resin with desktop UV lamp

    Hey guys, Doing some research in medical physics and for testing purposes I am tryin to set SLA photosensitive resin with just a desktop lamp .. It sets fine but the problem is it warps and I'd like to set a thin sheet like 10cm square and about 1-2mm thick and keep it flat. Any brilliant ideas ?
  9. P

    Python Extracting 2d array from numpy.pixel_array dicom image

    so it looks like its this easy.. 'array' is my array of shape [2,1024,1024] to get the two 1024x1024 arrays out is simply 1stArray = array[0] and 2ndArray = array[1] .. ill know for sure when i map them
  10. P

    Python Extracting 2d array from numpy.pixel_array dicom image

    Hi guys, I have a dicom image from a QC spect acquisition. reading the file in with dicom.read_file and pulling pixel data using numpy.pixel_array gives array of shape [2, 1024, 1024] The 2 represents two images, one from each detector head on the spect scanner and the 1024x1024 are the...
  11. P

    How can SLA printing produce colored resin?

    how do they make the resin different colours ? Is it a dye?
  12. P

    How to search a data frame by x and y cords in R

    Hi Readers, I seem to have hit an elementary snag while fiddling in R... i have a 5x5m surface interpolated at intervals of 0.01... giving 250,000 squares in my grid. i have roughly 20-30 xy cords where i want to retrieve the z value out of the data frame. does anyone know how to search an x y...
  13. P

    Is it possible to build atoms?

    Is it possible to "build" atoms? Was just thinking to myself, the world running out of resources etc... the most basic form of matter is the 3 subatomic particles... and all matter is made up of them. i did some googling but couldn't find much so I am wondering if one day it would be possible...
  14. P

    Entanglement Hypothesis by de Broglie in 1935

    I agree with LastOneStanding, fairly sure it was a 1935 paper on the EPR Paradox written by Einstein Podolsky and Rosen, hence EPR... since at the time they actually had no idea what they had discovered... and it was later the Schrodinger called it entanglement. If you google search EPR...
  15. P

    3D harmonic oscillator orbital angular momentum

    well id actually worked it out before i found the other solution, all it gave me was how to display the result. i learn by deconstructing the problem. and that's how i get my understanding up too. reading straight out of a book can be quite ambiguous sometimes. see, now when i go back...
Back
Top