smistad / FAST

A framework for high-performance medical image processing, neural network inference and visualization
https://fast.eriksmistad.no
BSD 2-Clause "Simplified" License
433 stars 101 forks source link

MacOS Running issue #154

Closed young-oct closed 10 months ago

young-oct commented 2 years ago

Describe the bug I installed FAST on MacOS12.2.1 (21D62) but I can’t run this https://fast.eriksmistad.no/scan_convert_iq_data_8py-example.html example

Please do not use issues for questions. Use the gitter chat for questions and discussions: https://gitter.im/smistad/FAST

To Reproduce

  1. install homebrew /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. install required package brew install openslide libomp
  3. In Anaconda pip install pyfast
  4. In pycharm run the code provided in this example import fast import numpy as np import matplotlib.pyplot as plt

Create some fake IQ beamspace data

iq_data = fast.Image.createFromArray(np.random.normal(size=(512,512,2)).astype(np.float32))

Add some geometric data used for scan conversion

iq_data.setFrameData('isPolar', 'true') iq_data.setFrameData('startRadius', '0') iq_data.setFrameData('stopRadius', '0.12') iq_data.setFrameData('startTheta', '-0.785398') # Start and stop angle in radians iq_data.setFrameData('stopTheta', '0.785398') iq_data.setFrameData('depthSpacing', '0.000235') iq_data.setFrameData('azimuthSpacing', '0.003074')

Create processing & visualization chain

envelope = fast.EnvelopeAndLogCompressor.create()\ .connect(iq_data)

scan_convert = fast.ScanConverter.create()\ .connect(envelope)

renderer = fast.ImageRenderer.create()\ .connect(scan_convert)

fast.SimpleWindow2D.create()\ .connect(renderer)\ .run()

Visualize output of scan converter with matplotlib instead of FAST:

plt.imshow(np.asarray(scan_convert.runAndGetOutputData())[..., 0], cmap='gray') plt.show()

System:

Expected behavior fake IQ data will show up Screenshots Error message from pycharm qt.qpa.window: <QNSWindow: 0x7fac7d9f6bb0; contentView=<QNSView: 0x7fac7d9f68f0; QCocoaWindow(0x6000031a5810, window=QWidgetWindow(0x6000022ed380, name="QGLWidgetClassWindow"))>> has active key-value observers (KVO)! These will stop working now that the window is recreated, and will result in exceptions when the observers are removed. Break in QCocoaWindow::recreateWindowIfNeeded to debug.

smistad commented 2 years ago

The example runs fine on my Mac running macOS 10.15 with system python 3.10. Can you try running the example without anaconda, just using a clean python environment?

young-oct commented 2 years ago

@smistad Thanks for getting to me. I gave it a try running with using anaconda. but still not working qt.qpa.window: <QNSWindow: 0x7fa2b8fdb2b0; contentView=<QNSView: 0x7fa2b8fdaca0; QCocoaWindow(0x600001eecfd0, window=QWidgetWindow(0x600000de9f20, name="QGLWidgetClassWindow"))>> has active key-value observers (KVO)! These will stop working now that the window is recreated, and will result in exceptions when the observers are removed. Break in QCocoaWindow::recreateWindowIfNeeded to debug. WARNING [0x1129a3600] Kernel binary Algorithms/Ultrasound/EnvelopeAndLogCompressor.cl is out of date. Compiling... WARNING [0x1129a3600] Kernel binary /ImageMinMax.cl is out of date. Compiling... WARNING [0x1129a3600] Kernel binary Algorithms/Ultrasound/ScanConverter.cl is out of date. Compiling...

smistad commented 10 months ago

Not able to reproduce, closing.

young-oct commented 10 months ago

@smistad thanks for looking into it.