Open tathey1 opened 3 years ago
Do you have error messages in the console?
also, just double checking, can you paste the output if you do:
curl -v <my local hrtp url>
?
yes, the console says 127.0.0.1 - - [05/Nov/2021 11:57:37] "GET / HTTP/1.1" 200 -
here's the output from the command
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 9020 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1:9020
> User-Agent: curl/7.64.1
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server: SimpleHTTP/0.6 Python/3.8.10
< Date: Fri, 05 Nov 2021 16:42:23 GMT
< Content-type: text/html; charset=utf-8
< Content-Length: 421
< Access-Control-Allow-Origin: *
<
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Directory listing for /</title>
</head>
<body>
<h1>Directory listing for /</h1>
<hr>
<ul>
<li><a href=".DS_Store">.DS_Store</a></li>
<li><a href="avg152T1_LR_nifti%20%281%29.nii">avg152T1_LR_nifti (1).nii</a></li>
</ul>
<hr>
</body>
</html>
* Closing connection 0
where avg152T1_LR_nifti (1).nii
is the name of my nifti file.
it looks like <my local hrtp url>
is incorrect.
my suspicion is that you need to use <my local hrtp url>/avg152T1_LR_nifti%20%281%29.nii
instead
I believe the nifti://
protocol expects a single nifti file, rather than the root directory (unlike precomputed://
for example)
perfect, that's it! Let me know if you think it would be useful for me to make a PR involving some step by step documentation on how to do what you helped me do - view a local nifti file at the neuroglancer demo appspot.
I'm not the maintainer of neuroglancer, just passer by 😅
with the neuroglancer hosted on appspot, there is an additional obstacle: it is hosted on https, and by default, browser will restrict HTTP calls made from https origin to http origin (not the otherway around).
A less risky way, perhaps, is to leverage the drag and drop of nifti, and use URL.createObjectURL
on the dropped file, and point to it with the nifti://
(shameless self plug, we do that with our fork of the neuroglancer)
Hi - My goal is to view a local nifti file (.nii) on the neuroglancer demo appspot. So, I made a directory and placed the file in it, then ran cors_webserver.py to serve that directory. However, when I entered the corresponding url into neuroglancer:
nifti://<my local hrtp url>
I got aFailed to parse NIFTI header.
error. I thought this might be the .nii file format so I tried again with separate hdr and img files but stll got an error.My .nii file is from the nitrc website, so I don't think it is a case of a corrupted file. I wanted to ask if there is something obvious that I am doing wrong? Do I need to change the name of the nifti file or something?
Thanks in advance.