Skip to content

Add option to save IMS file in a specified location #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/imcflibs/imagej/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@
return imaris_paths[-1]


def run_imarisconvert(file_path, pixel_calibration=None):
def run_imarisconvert(file_path, output_folder=None, pixel_calibration=None):
"""Convert a given file to Imaris format using ImarisConvert.

Convert the input image file to Imaris format (Imaris5) using the
Expand All @@ -680,6 +680,8 @@
----------
file_path : str
Absolute path to the input image file.
output_folder : str, optional
Folder where the newly created IMS file will be saved, by default None.
pixel_calibration : tuple or list, optional
Sequence of 3 values (x, y, z) representing voxel dimensions to be set during
conversion, by default None.
Expand All @@ -693,9 +695,12 @@

imaris_path = locate_latest_imaris()

if not output_folder:
output_folder = os.getcwd()

Check warning on line 699 in src/imcflibs/imagej/misc.py

View check run for this annotation

Codecov / codecov/patch

src/imcflibs/imagej/misc.py#L698-L699

Added lines #L698 - L699 were not covered by tests

command = 'ImarisConvert.exe -i "%s" -of Imaris5 -o "%s"' % (
file_path,
file_path.replace(file_extension, ".ims"),
os.path.join(output_folder, file_path.replace(file_extension, ".ims")),
)
if pixel_calibration:
command = command + " --voxelsizex %s --voxelsizey %s --voxelsizez %s" % (
Expand Down
Loading