1

The Context: I'm trying to use the package trackpy for research. I'm on a Mac and I'm using (mostly) Spyder. I’m following the trackpy walkthrough (https://soft-matter.github.io/trackpy/v0.3.2/tutorial/walkthrough.html) and I’m trying to use it on a tif file. Here’s my code:

#Install trackpy (https://soft-matter.github.io/trackpy/v0.3.2/installation.html)
!conda update conda --yes
!conda install -c conda-forge trackpy --yes

#Use trackpy (trackpy walkthrough: https://soft-matter.github.io/trackpy/v0.3.2/tutorial/walkthrough.html)
from __future__ import division, unicode_literals, print_function
import matplotlib as mpl
import matplotlib.pyplot as plt
%matplotlib inline

import numpy as np
import pandas as pd
from pandas import DataFrame, Series
import pims
import trackpy as tp

#Install libtif for pims.Tiffstack, per the README (which leads to this link: http://nbviewer.jupyter.org/github/soft-matter/pims/blob/master/examples/loading%20video%20frames.ipynb)
!conda install libtiff --yes

frames = pims.TiffStack("/Users/(my username)/Documents/TSVIEW_Test_5_Grey_1.tif", as_grey=True)

The Problems: When I first wrote the code, I got the error:

TypeError: init() got an unexpected keyword argument 'as_grey'

According to the trackpy walkthrough, it should take as_grey as an argument.

However, when I restarted my computer, I got a different error message (without any code changes as far as I can tell):

/anaconda3/lib/python3.5/site-packages/tifffile/tifffile.py:2113: UserWarning: invalid ImageJ metadata or corrupted file warnings.warn('invalid ImageJ metadata or corrupted file')

Again, I didn't change the code between restarting it.

Interestingly, when I tried this code in a different python-running software, I got the first error again. I tried it in Google Colab. The only changes I made to the code were using pip instead of conda (Colab only supports pip), downloading the additional dependencies needed for pip per the trackpy install page (https://soft-matter.github.io/trackpy/v0.3.2/installation.html), and uploading the file to Colab per the 'External data: Drive, Sheets, and Cloud Storage' Colab guide.

Things I've tried: I’ve researched both problems. For the first, I found a page that asked the same problem (pims.Video parameter issue in Spyder), but the only solution provided is "an installation issue" where certain modules are "from the wrong source.” If this is right (is it?), what does it mean? How can I install the modules from the right source?

For the second, I found from the pims website that pims is based on the the tifffile dependency (http://soft-matter.github.io/pims/v0.4/tiff_stack.html). I then found the code that brought the error message (line 2415 from the tifffile.py page https://github.com/scikit-image/scikit-image/blob/master/skimage/external/tifffile/tifffile.py), but I still don’t know how to solve it.

How can I solve these errors?

0 Answers0