magellanmapper
magellanmapper copied to clipboard
Can't import files on windows version of MM v.1.4
Hi,
I am having a trouble uploading tiff files (from lightsheet microscope) to the magellanmapper. I can't upload nor single file nor series of files (I changed the microscopic metadata several times, but with no success on resolving import issue
)
Any suggestions?
Hi @PedjaJJ, thanks for reporting this! The settings look right, so there may be an issue in how MM read the image. Do you see any console or log output? If you're running MM without a console (eg the installer version), you can find the log output saved in this file: C:\Users\<your-username>\AppData\Local\MagellanMapper\out.log
. If you could post any error messages, hopefully that will help us pinpoint the issue.
This could also be related to an issue in v1.4 where there's an error if the output directory doesn't already exist (see #43), though it doesn't look that's the case here. If it is, the workaround is to manually create the folders beforehand. I've also seen some issues with imports in the Bio-Formats library in v1.4 that are fixed in the upcoming version, v1.5.
Hi @yoda-vid ,
Thank you for this fast replay. I did what you suggested and it turns out that I didn't have enough memory :) for the npy file in my output folder.
I resolve that and I was able to import all pictures but at the end I got msg that task couldn't be completed (please see the log below).
I was not able to pinpoint the issue here so maybe you could help me
Thanks for the posting the log, @PedjaJJ! I think the importer tried to load the .npy
file from the prior import and gave an error. If you remove that file and rerun the import, does it complete the task?
Hi @yoda-vid thanks for the help. It worked!
Great, so glad it worked, @PedjaJJ!
I think you've highlighted a few things I'll try to add to make the import process smoother:
- Show the error output in the import window
- Ignore files that can't be imported
- Provide a pointer to the log output for more detailed messages
Let me know if there's anything else to add. Thanks again for reaching out!
One more comment about importing of files. I am importing files from LaVista lightsheet microscope and he arranges channel designation as _C0_
or _C1_
. Is it possible to change from _ch_<n>
to _C<n>_
and how?
Right now it only reads the _ch_<n>
format, but this is a great suggestion to make it more flexible. I'll note customizing the channel designator as a future feature.
A workaround I've used is to create another folder with each file linked using a name in the _ch_<n>
format. Here is the Bash script function that I use on Mac, which should also work in Linux (unfortunately not on Windows except when running magmap through WSL):
# Create links to filename format for import into MagellanMapper.
# Args:
# 1: Input directory path.
# 2: Output directory path.
ln_imgs_for_magmap() {
local in_dir="$1"
local out_dir="$2"
if [[ ! -d "$out_dir" ]]; then
# create output dir
echo "Making output directory: ${out_dir}"
mkdir "$out_dir"
fi
cd "$out_dir" || exit 1
for f in "$in_dir"/*; do
# create symbolic link from input to output folder, renamed with channel modifier;
# assumes that output files will have the same order in as the input dir
name="$(basename "$f")"
IFS='_' read -ra name_split <<< "$name"
echo "${name_split[*]}"
name_out="${name_split[0]}_${name_split[1]}_ch_${name_split[2]}"
echo "$name_out"
ln -s -f "$f" "$name_out"
done
}
# run the function, changing the input/output directories to your paths
ln_imgs_for_magmap <input-dir-path> <output-dir-path>
I have been able to resolve this simple by using Bulk Rename Utility https://www.bulkrenameutility.co.uk/
Great, thank you for pointing out this resource! Very useful.