Git Product home page Git Product logo

Comments (26)

ayselafsar avatar ayselafsar commented on September 15, 2024 5

The viewer would automatically load all DICOM files in the whole directory and its sub directories where a DICOM file is opened. It will display that specific DICOM image in the viewport on load, but you would be able to display other images of the same series in the viewport or display the other series or studies from the left panel. That is why we have not worked on adding "Open with DICOM Viewer" option at folder level in this version, but we could add it back in the next version if that would prevent such confusion.

The issue with opening DICOM files in 2 or more level sub folders is definitely a bug which we will fix in the next version.

Here is the action items for the next version:

  • Use default apps directory when "apps_paths" is missing in the config file
  • Fix the issue with opening DICOM files in 2 or more level directories
  • Add "Open with DICOM Viewer" option at folder level
  • Support loading extensionless DICOM files when a folder is opened with "Open with DICOM Viewer" option

from dicomviewer.

ayselafsar avatar ayselafsar commented on September 15, 2024 1

It could not get the apps path to be able to access the static viewer files here: https://github.com/ayselafsar/dicomviewer/blob/master/lib/Controller/DisplayController.php#L50
Could you please send me your nextcloud config file (DO NOT FORGET TO REMOVE SENSITIVE DATA) and let me know where apps folder is located on your environment.

from dicomviewer.

ayselafsar avatar ayselafsar commented on September 15, 2024 1

Please follow the nextcloud documentation in that link, it must be added as an array:

'apps_paths' => [
        [
                'path'=> '/var/www/nextcloud/apps',
                'url' => '/apps',
                'writable' => true,
        ],
],

from dicomviewer.

ayselafsar avatar ayselafsar commented on September 15, 2024 1

Could you please check if the “datadirectory” which is defined in your nextcloud config file is correct and valid in your file system? This could happen when the viewer could not find DICOM files in your file system.

from dicomviewer.

smolinde avatar smolinde commented on September 15, 2024 1

The sidebar works totally different than the viewer. The viewer server-side code finds DICOM files in the file system based on the username and file path passed in the url. Is there any other error in your nextcloud log file, or is there any chance to create a test nextcloud instance where this is reproducible for us? If that is not possible, could you at least let us know which instructions you followed to set up your nextcloud instance? So, we can try to setup in the same way to reproduce this issue. During our tests, we confirmed that it works in the nextcloud instances which were set up using snap.

I followed the official tutorial. However, I can provide you with a full sample instance. For this purpose I need a little bit more time and I will send you all credentials.

from dicomviewer.

BlackDex avatar BlackDex commented on September 15, 2024 1

I was also missing the apps_paths, but also after adding this, it still does not work.

I get the following error message in the logs:

See Log
{
    "app": "index",
    "exception":
    {
        "Code": 0,
        "CustomMessage": "method_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given in file '/data/web/nextcloud/apps/dicomviewer/lib/Nanodicom/nanodicom/core.php' line 474",
        "Exception": "Exception",
        "File": "/data/web/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "Line": 169,
        "Message": "method_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given in file '/data/web/nextcloud/apps/dicomviewer/lib/Nanodicom/nanodicom/core.php' line 474",
        "Previous":
        {
            "Code": 0,
            "Exception": "TypeError",
            "File": "/data/web/nextcloud/apps/dicomviewer/lib/Nanodicom/nanodicom/core.php",
            "Line": 474,
            "Message": "method_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given",
            "Trace":
            [
                {
                    "file": "/data/web/nextcloud/apps/dicomviewer/lib/Nanodicom/nanodicom/core.php",
                    "function": "method_exists",
                    "line": 474
                },
                {
                    "class": "Nanodicom_Core",
                    "file": "/data/web/nextcloud/apps/dicomviewer/lib/Controller/DisplayController.php",
                    "function": "profiler_diff",
                    "line": 164,
                    "type": "->"
                },
                {
                    "class": "OCA\\DICOMViewer\\Controller\\DisplayController",
                    "file": "/data/web/nextcloud/apps/dicomviewer/lib/Controller/DisplayController.php",
                    "function": "generateDICOMJson",
                    "line": 444,
                    "type": "->"
                },
                {
                    "class": "OCA\\DICOMViewer\\Controller\\DisplayController",
                    "file": "/data/web/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                    "function": "getDICOMJson",
                    "line": 230,
                    "type": "->"
                },
                {
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "file": "/data/web/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                    "function": "executeController",
                    "line": 137,
                    "type": "->"
                },
                {
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "file": "/data/web/nextcloud/lib/private/AppFramework/App.php",
                    "function": "dispatch",
                    "line": 184,
                    "type": "->"
                },
                {
                    "class": "OC\\AppFramework\\App",
                    "file": "/data/web/nextcloud/lib/private/Route/Router.php",
                    "function": "main",
                    "line": 315,
                    "type": "::"
                },
                {
                    "class": "OC\\Route\\Router",
                    "file": "/data/web/nextcloud/lib/base.php",
                    "function": "match",
                    "line": 1069,
                    "type": "->"
                },
                {
                    "class": "OC",
                    "file": "/data/web/nextcloud/index.php",
                    "function": "handleRequest",
                    "line": 39,
                    "type": "::"
                }
            ]
        },
        "Trace":
        [
            {
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "file": "/data/web/nextcloud/lib/private/AppFramework/App.php",
                "function": "dispatch",
                "line": 184,
                "type": "->"
            },
            {
                "class": "OC\\AppFramework\\App",
                "file": "/data/web/nextcloud/lib/private/Route/Router.php",
                "function": "main",
                "line": 315,
                "type": "::"
            },
            {
                "class": "OC\\Route\\Router",
                "file": "/data/web/nextcloud/lib/base.php",
                "function": "match",
                "line": 1069,
                "type": "->"
            },
            {
                "class": "OC",
                "file": "/data/web/nextcloud/index.php",
                "function": "handleRequest",
                "line": 39,
                "type": "::"
            }
        ],
        "exception":
        {},
        "message": "method_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given in file '/data/web/nextcloud/apps/dicomviewer/lib/Nanodicom/nanodicom/core.php' line 474"
    },
    "level": 3,
    "message": "method_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given in file '/data/web/nextcloud/apps/dicomviewer/lib/Nanodicom/nanodicom/core.php' line 474",
    "method": "GET",
    "remoteAddr": "XXX",
    "reqId": "gKmVlVQa4wVyqh2evS1l",
    "time": "2024-03-19T18:44:22+01:00",
    "url": "/apps/dicomviewer/dicomjson?file=BlackDex|/From%20Hospital/Body%20-%207183/feet_x_y__30_3/IM-0001-0001.dcm",
    "user": "BlackDex",
    "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0",
    "version": "28.0.3.2"
}

from dicomviewer.

ayselafsar avatar ayselafsar commented on September 15, 2024 1

We were actually able to reproduce this issue. It only happens with the DICOM files which are in 2 or more level sub folders. Could you please give it a try with DICOM files which are located in the first level sub folder in Nextcloud (e.g. /test/001.dcm)?

from dicomviewer.

BlackDex avatar BlackDex commented on September 15, 2024 1

We were actually able to reproduce this issue. It only happens with the DICOM files which are in 2 or more level sub folders. Could you please give it a try with DICOM files which are located in the first level sub folder in Nextcloud (e.g. /test/001.dcm)?

Yes, indeed!

  • It doesn't work in a subsubfolder
  • It works in root (home) directory of Nextcloud
  • It works in a first level directory

This is very strange behavior but I can definitely confirm this.

Same here btw, except that for me it does not work from the root for some reason.

It does work in a sub-subfolder when shared though.

And i do miss the option for a folder to open that with the viewer. Although it does show all files even when clicked on just one though.

from dicomviewer.

BlackDex avatar BlackDex commented on September 15, 2024 1

And, the support for files without an extension is gone now.

from dicomviewer.

BlackDex avatar BlackDex commented on September 15, 2024 1

Thanks @ayselafsar, both for the quick response and this extension.

I use it for the vet results of our dog mostly, which is very nice.

from dicomviewer.

smolinde avatar smolinde commented on September 15, 2024 1

Amazing tool integration of acanio, also big thanks from me @ayselafsar! :D

from dicomviewer.

arnowelzel avatar arnowelzel commented on September 15, 2024 1

It could not get the apps path to be able to access the static viewer files here: https://github.com/ayselafsar/dicomviewer/blob/master/lib/Controller/DisplayController.php#L50 Could you please send me your nextcloud config file (DO NOT FORGET TO REMOVE SENSITIVE DATA) and let me know where apps folder is located on your environment.

I believe that this is not the correct way. Please see https://github.com/nextcloud/server/blob/90e2146146966fd99bae1346fe06ffa89bd0a5c7/lib/private/URLGenerator.php#L152 how to obtain the path of an app.

from dicomviewer.

crami avatar crami commented on September 15, 2024

Same Issue here. All the DICOM files I have do not have a file extension. If I ad a .dcm extension to file the Preview works in the sidepane bit not the fullscreen view, there I get an internal server error.

from dicomviewer.

smolinde avatar smolinde commented on September 15, 2024

Same issue, please fix it! :)
Error log:
foreach() argument must be of type array|object, string given at /var/www/nextcloud/apps/dicomviewer/lib/Controller/DisplayController.php#51
Ubuntu 23.10 Server (x64) on Raspberry Pi 5, Nextcloud 28.0.3, DICOM Viewer 2.0.0

from dicomviewer.

smolinde avatar smolinde commented on September 15, 2024

Nextcloud Configuration:

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***",
            "127.0.0.1"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "28.0.3.2",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "htaccess.RewriteBase": "\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "filelocking.enabled": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "maintenance": false,
        "trashbin_retention_obligation": "30, auto",
        "default_phone_region": "DE",
        "default_language": "en_US",
        "default_locale": "de",
        "force_locale": "de",
        "allow_local_remote_servers": true,
        "app_install_overwrite": [
            "backup",
            "breezedark",
            "cms_pico",
            "extract",
            "holiday_calendars",
            "files_markdown",
            "metadata",
            "music",
            "news",
            "files_texteditor",
            "quicknotes",
            "ransomware_protection",
            "files_retention",
            "files_rightclick",
            "video_converter",
            "dicomviewer"
        ],
        "onlyoffice": {
            "verify_peer_off": true,
            "jwt_header": "AuthorizationJwt"
        },
        "encryption_skip_signature_check": true,
        "theme": "",
        "loglevel": 2,
        "maintenance_window_start": 1
    }
}

Nextcloud App folder location: /var/www/nextcloud/apps

from dicomviewer.

ayselafsar avatar ayselafsar commented on September 15, 2024

Your nextcloud config file is missing apps_paths. Could you please test it again after adding it into your nextcloud config file?

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#apps-paths

If that works, we could let it use the default apps folder in the code when it is missing in the config file.

from dicomviewer.

smolinde avatar smolinde commented on September 15, 2024

Your nextcloud config file is missing apps_paths. Could you please test it again after adding it into your nextcloud config file?

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#apps-paths

If that works, we could let it use the default apps folder in the code when it is missing in the config file.

If I understood it right, I have added 'apps_path' => '/var/www/nextcloud/apps' but the error still persists.

EDIT: I changed it to apps_paths but now nothing works. Could you tell me how to set it properly?

from dicomviewer.

smolinde avatar smolinde commented on September 15, 2024

Please follow the nextcloud documentation in that link, it must be added as an array:

'apps_paths' => [
        [
                'path'=> '/var/www/nextcloud/apps',
                'url' => '/apps',
                'writable' => true,
        ],
],

This works. But now there is another problem; The entire page is just black. See screenshot:

Screenshot_DICOM

EDIT: Here is the error in logs:
Exception
method_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given in file '/var/www/nextcloud/apps/dicomviewer/lib/Nanodicom/nanodicom/core.php' line 474
/var/www/nextcloud/lib/private/AppFramework/App.php
line 184
OC\AppFramework\Http\Dispatcher->dispatch()
/var/www/nextcloud/lib/private/Route/Router.php
line 315
OC\AppFramework\App::main()
/var/www/nextcloud/lib/base.php
line 1069
OC\Route\Router->match()
/var/www/nextcloud/index.php
line 39
OC::handleRequest()
Caused by TypeError
method_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given

from dicomviewer.

smolinde avatar smolinde commented on September 15, 2024

Could you please check if the “datadirectory” which is defined in your nextcloud config file is correct and valid in your file system? This could happen when the viewer could not find DICOM files in your file system.

My datadirectory 'datadirectory' => '/var/www/nextcloud/data' works good and all my files are accessible. Moreover, in file preview, DICOM Viewer displays the file image and all properties correctly. Just like in the case of the issue creator @BlackDex

from dicomviewer.

ayselafsar avatar ayselafsar commented on September 15, 2024

The sidebar works totally different than the viewer. The viewer server-side code finds DICOM files in the file system based on the username and file path passed in the url. Is there any other error in your nextcloud log file, or is there any chance to create a test nextcloud instance where this is reproducible for us? If that is not possible, could you at least let us know which instructions you followed to set up your nextcloud instance? So, we can try to setup in the same way to reproduce this issue. During our tests, we confirmed that it works in the nextcloud instances which were set up using snap.

from dicomviewer.

ayselafsar avatar ayselafsar commented on September 15, 2024

@smolinde Feel free to send me an email at [email protected]

from dicomviewer.

smolinde avatar smolinde commented on September 15, 2024

We were actually able to reproduce this issue. It only happens with the DICOM files which are in 2 or more level sub folders. Could you please give it a try with DICOM files which are located in the first level sub folder in Nextcloud (e.g. /test/001.dcm)?

Yes, indeed!

  • It doesn't work in a subsubfolder
  • It works in root (home) directory of Nextcloud
  • It works in a first level directory

This is very strange behavior but I can definitely confirm this.

from dicomviewer.

smolinde avatar smolinde commented on September 15, 2024

And, the support for files without an extension is gone now.

Same here. So for now, we identified three issues:

  • No support for extensionless files
  • No support for opening whole DICOM directory
  • Works only if files are in a 0/1st level directory or when shared

Is there still a need for a test instance?

from dicomviewer.

nursoda avatar nursoda commented on September 15, 2024

I my case, it does also NOT work for user B, when user A has a subdirectory containing a DICOM directory and shares that (to root level) to user B.

from dicomviewer.

arnowelzel avatar arnowelzel commented on September 15, 2024

Please follow the nextcloud documentation in that link, it must be added as an array:

'apps_paths' => [
        [
                'path'=> '/var/www/nextcloud/apps',
                'url' => '/apps',
                'writable' => true,
        ],
],

I added this (with the correct paths of course) since my setup also does not work any longer. However I wonder why this is needed - Nextcloud knows the app path without that setting as well and I did not have any other app yet which needs this.

Anyway - this did not change anything. Opening a directory with the DICOM Viewer as with Nextcloud 27 is no longer possible. There is no menu item to open a directory with the DICOM viewer any longer.

My DICOM directories do not contain any ".dcm" file at all, just a file "DICOMDIR" and a folder "DICOM" with subfolders like this:

DICOMDIR
DICOM
  20191028
    12490000
      15649777 (this is a file)
      15649793 (this is a file)
      ... 
    13190000
      ... 
    13270000
      ... 
    13310000
      ... 

from dicomviewer.

ayselafsar avatar ayselafsar commented on September 15, 2024

We are currently working on these issues and will release a new version soon.

I believe that this is not the correct way. Please see https://github.com/nextcloud/server/blob/90e2146146966fd99bae1346fe06ffa89bd0a5c7/lib/private/URLGenerator.php#L152 how to obtain the path of an app.

This is a good point. Thanks!

from dicomviewer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.