You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey guys. I am relatively unfamiliar with the imagej macro language and I've got a code that seems to have a problem with the calling the images that i want to batch process. Anyone got any idea of why it doesnt work?
The error log from imagej (which opens when running it via a jupyter notebook) says the image doesnt exist, however its there and i guess its rather a problem with the path/mca
import os
import shutil
import subprocess
from tqdm import tqdm
Function to process and save a CZI file with ImageJ commands
Function to copy directory structure and process CZI files
def process_and_copy_structure(input_directory, output_directory):
# Walk through the input directory
for root, dirs, files in os.walk(input_directory):
# Construct the corresponding path in the output directory
relative_path = os.path.relpath(root, input_directory)
output_path = os.path.join(output_directory, relative_path)
# Create the corresponding subfolder in the output directory
os.makedirs(output_path, exist_ok=True)
# Process each CZI file in the current subfolder
for file in tqdm(files, desc=f"Processing {relative_path}", unit="file"):
if file.endswith(".czi"):
process_czi_with_imagej(input_directory, output_directory, file)
Hey guys. I am relatively unfamiliar with the imagej macro language and I've got a code that seems to have a problem with the calling the images that i want to batch process. Anyone got any idea of why it doesnt work?
The error log from imagej (which opens when running it via a jupyter notebook) says the image doesnt exist, however its there and i guess its rather a problem with the path/mca
import os
import shutil
import subprocess
from tqdm import tqdm
Function to process and save a CZI file with ImageJ commands
def process_czi_with_imagej(input_directory, output_directory, czi_file):
czi_file_path = os.path.join(input_directory, czi_file)
Function to copy directory structure and process CZI files
def process_and_copy_structure(input_directory, output_directory):
# Walk through the input directory
for root, dirs, files in os.walk(input_directory):
# Construct the corresponding path in the output directory
relative_path = os.path.relpath(root, input_directory)
output_path = os.path.join(output_directory, relative_path)
Example usage
input_directory = r"xxx"
output_directory = r"xxx"
process_and_copy_structure(input_directory, output_directory)
The text was updated successfully, but these errors were encountered: