-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathPython05-2.py
More file actions
24 lines (19 loc) · 843 Bytes
/
Python05-2.py
File metadata and controls
24 lines (19 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Python05-2.py
# IJ BAR: https://github.com/tferr/Scripts#scripts
####################################################
# 5.2 Scripting ImageJ: Creating an empty image (II)
####################################################
# Now that we have the documentation opened in our browsers,
# It will be easy to create the empty image:
import ij.gui.NewImage as NI
# First we define all the arguments
title = "My Image" # The image title
width = 512 # Image dimension: width
height = 512 # Image dimension: height
n_slices = 10 # Image dimension: depth
bit_depth = 8 # Acceptable values: 8, 16, 24 (RGB) and 32 (float)
options = NI.FILL_RAMP # other choices: FILL_BLACK, FILL_WHITE
# Now we create the image (an ImagePlus object)
image = NI.createImage(title, width, height, n_slices, bit_depth, options)
# Finally we show it!
image.show()