In [26]:
###################
# set up the environment, nis, and image saving path
#####################
import os
from nis_util import *

path_to_nis = 'C:\\Program Files\\NIS-Elements\\nis_ar.exe'
#save_base_path = 'E:\\aquisition data\\Nicolas\\Overviews'

# save_base_path = 'C:\\Users\\Nikon\\Documents\\TEST'
save_base_path = 'E:\\aquisition data\\Nicolas\\Overviews'

In [ ]:


In [27]:
###################
# select and name the scans
#####################

# put the name of the optical configuration to use here
#set_optical_configuration(path_to_nis, 'Dia-4x')

#####################################
# where to save the files, for example
# save_path_left = 'NG_Overview_024.nd2'
#
# if no slide just put None. For example:
# save_path_left = None
########################################
save_path_left  = 'YX_Overview_0405016.nd2' #None
save_path_mid   = 'YQ_Overview_0405017.nd2' #None
save_path_right = 'YQ_Overview_0405018.nd2' #None



save_path_right = os.path.join(save_base_path, save_path_right) if (save_path_right != None) else None
save_path_mid   = os.path.join(save_base_path, save_path_mid)   if (save_path_mid   != None) else None
save_path_left  = os.path.join(save_base_path, save_path_left)  if (save_path_left  != None) else None

In [28]:
############################
# run the scan
# before running the scan, you should make the focus correctly
# skips files that already exist
############################
    
# the bounding boxes of the slide holders

# left slide
do_scan_left  = save_path_left != None
if (do_scan_left and (os.path.exists(save_path_left))):
    print('WARNING: file {} exists.'.format(save_path_left))
    do_scan_left = False
if do_scan_left:
    print('Scanning left scan.')
    do_large_image_scan(path_to_nis, save_path_left, 53331, 28806, -20726, 20464)
else:
    print('Skipping left slide.')

# mid slide
do_scan_mid  = save_path_mid != None
if (do_scan_mid and os.path.exists(save_path_mid)):
    print('WARNING: file {} exists.'.format(save_path_mid))
    do_scan_mid = False
if do_scan_mid:
    print('Scanning mid scan.')
    do_large_image_scan(path_to_nis, save_path_mid, 13400, -7850, -20954, 18220)
else:
    print('Skipping middle slide.')

# right slide
do_scan_right  = save_path_right != None
if (do_scan_right and os.path.exists(save_path_right)):
    print('WARNING: file {} exists.'.format(save_path_right))
    do_scan_right = False
if do_scan_right:
    print('Scanning right scan.')
    do_large_image_scan(path_to_nis, save_path_right, -26500, -50000, -21053, 18177)
else:
    print('Skipping right slide.')


Scanning left scan.
Scanning mid scan.
Scanning right scan.

In [108]:
do_large_image_scan(path_to_nis, save_path_left, 53331, 28806, -20726, 20464)