Skip to content
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

Can't import files on windows version of MM v.1.4 #82

Open
PedjaJJ opened this issue Oct 18, 2021 · 9 comments
Open

Can't import files on windows version of MM v.1.4 #82

PedjaJJ opened this issue Oct 18, 2021 · 9 comments

Comments

@PedjaJJ
Copy link

PedjaJJ commented Oct 18, 2021

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
Screenshot 2021-10-18 133037
Screenshot 2021-10-18 133144
)
Any suggestions?

@yoda-vid
Copy link
Collaborator

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.

@PedjaJJ
Copy link
Author

PedjaJJ commented Oct 19, 2021

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).
Screenshot 2021-10-19 120453
I was not able to pinpoint the issue here so maybe you could help me

@yoda-vid
Copy link
Collaborator

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?

@PedjaJJ
Copy link
Author

PedjaJJ commented Oct 21, 2021

Hi @yoda-vid thanks for the help. It worked!

@yoda-vid
Copy link
Collaborator

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!

@PedjaJJ
Copy link
Author

PedjaJJ commented Oct 21, 2021

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?

@yoda-vid
Copy link
Collaborator

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>

@PedjaJJ
Copy link
Author

PedjaJJ commented Oct 27, 2021

I have been able to resolve this simple by using Bulk Rename Utility https://www.bulkrenameutility.co.uk/

@yoda-vid
Copy link
Collaborator

Great, thank you for pointing out this resource! Very useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants