MIC-DKFZ / niicat

This is a tool to quickly preview nifti images on the terminal
GNU General Public License v2.0
51 stars 10 forks source link

AttributeError: type object 'Path' has no attribute 'home' #1

Closed soichih closed 4 years ago

soichih commented 4 years ago

I've pip3 installed niicat on my Ubuntu 18 machine, but I am having trouble running it.

$ niicat t1.nii.gz 
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/niicat/resources/niipre.py", line 17, in <module>
    home = str(Path.home())
AttributeError: type object 'Path' has no attribute 'home'

I am using

$ python3 --version
Python 3.6.8

Cool project!

wasserth commented 4 years ago

I can not reproduce this error. Seems a bit strange. However, it turned out that Path.home() was not needed. I refactored the code, so now it should work without. If you upgrade to the newest version does it work?

soichih commented 4 years ago

Now I am seeing this

  File "/usr/local/lib/python3.6/dist-packages/niicat/resources/niipre.py", line 195, in <module>
    plt.savefig(sys.stdout.buffer, dpi=120)
AttributeError: 'file' object has no attribute 'buffer'

Also, I don't think my terminal supports sixel.. I really don't know how to enable it actually. Which terminal are you using?

wasserth commented 4 years ago

I am using iterm2 (v 3.3.6). That works fine. The libsixel readme contains a list of all compatible terminals.

soichih commented 4 years ago

Ok thanks. I've tried xterm -ti vt340 on Ubuntu 18 and 19 and it seems work! Although.. the image quality isn't too great (I think the issue is with xterm..)

Screenshot from 2019-11-13 08-37-33

By the way, here is the ascii (img2txt/utf8) rendering of the same image.

Screenshot from 2019-11-13 09-01-12

As long as I keep the font size small, it looks somewhat decent.. ?

wasserth commented 4 years ago

For me the image quality is a lot better. It might depend on the sixel implementation of the terminal.