0
# Create an ImageJ gateway with the newest available version of ImageJ.
import imagej
import pathlib
import numpy
ij = imagej.init()
# Load an image.
img_path = pathlib.Path('C:/Users/Bernardo/TCC/thyroid/1_1.jpg')
image = ij.io().open(str(img_path))
ij.py.show(image, cmap='gray')

I wanna plot a histogram using pyimagej, after reading this image.

Oren
  • 4,711
  • 4
  • 37
  • 63

1 Answers1

0

well, you can just use matplotlib:

# Create an ImageJ gateway with the newest available version of ImageJ.
import imagej
import pathlib
import numpy
ij = imagej.init()
# Load an image.
img_path = pathlib.Path('C:/Users/Bernardo/TCC/thyroid/1_1.jpg')
image = ij.io().open(str(img_path))
ij.py.show(image, cmap='gray')

import matplotlib.pyplot as plt
plt.hist(image.flatten())
Oren
  • 4,711
  • 4
  • 37
  • 63