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

Problem of find images when use "papaya-builder.sh -atlas myAtlas.xml" #186

Closed
cirongliu opened this issue Jan 5, 2020 · 2 comments
Closed

Comments

@cirongliu
Copy link

cirongliu commented Jan 5, 2020

I was trying to use the "papaya-builder.sh -atlas myAtlas.xml" to build with a custom atlas.

However, during the building, the program will always automatically add "null/" to the file location declared in the XML file. For example, I put "Talairach.xml" and "Talairach_labels_1mm.nii.gz" in the same folder of "papaya-builder.sh" and ran "papaya-builder.sh -atlas Talairach.xml", here was the outcome:
"
Cleaning output directory...
Including atlas Talairach.xml
Using atlas image file null/Talairach_labels_1mm.nii.gz
Problem finding atlas file. Reason: Source 'null/Talairach_labels_1mm.nii.gz' does not exist
Compressing JavaScript...
Further compressing...
Done! See build folder for output...

"

How to remove the "null"?

Thanks!

@cirongliu
Copy link
Author

Thanks. I found the solution after several testing. I need add path to the myAtlas.xml as well. It should be

"papaya-builder.sh -atlas /path/myAtlas.xml"

@juan-d
Copy link

juan-d commented Feb 25, 2022

Hello,

When trying to use papaya-builder.sh -atlas myAtlas.xml (in macOS Catalina), I am getting the following error:

Exception in thread "main" org.json.JSONException: JSONObject["images"] not found.
at org.json.JSONObject.get(JSONObject.java:473)
at org.json.JSONObject.getJSONObject(JSONObject.java:573)
at edu.uthscsa.ric.papaya.builder.Atlas.findImageFile(Atlas.java:76)
at edu.uthscsa.ric.papaya.builder.Atlas.createAtlas(Atlas.java:37)
at edu.uthscsa.ric.papaya.builder.Builder.main(Builder.java:257)

I have tried numerous things so that 'images' (which I assume are the 'imagefile' and the 'summaryimagefile' in the FSL Atlas Specification) can be found by the builder script.

This is my directory structure:

Papaya
├── LICENSE
├── README.md
├── atlas
 | ├── myImage.nii
 | └── mySummaryimage.nii
├── build
├── build.properties
├── docs
├── lib
├── myAtlas.xml
├── myImage.nii
├── mySummaryimage.nii
├── package-lock.json
├── package.json
├── papaya-builder.sh
├── release
├── src
└── tests

I am running papaya-builder.sh form inside this folder.

This is the header in my xml file (myAtlas.xml):

<?xml version="1.0" encoding="ISO-8859-1"?>
<atlas version="1.0">
  <header>
    <name>My Atlas</name>
    <type>Label</type>
    <imagefile>/atlas/myImage/</imagefile>
    <summaryimagefile>/atlas/mySummaryimage/</summaryimagefile>
  </header>
  <data>

I have tried placing myImage.nii (4D image with a region in each volume) and mySummaryimage.nii (3D image with all labelled regions I a single volume) in an atlas folder inside the Papaya folder (/Papaya/atlas/), with the xml header as above, and in the same directory as myAtlas.xml (within the /Papaya/ folder). In the latter case, I have amended the xml header this way:

<imagefile>/myImage/</imagefile>
<summaryimagefile>/mySummaryimage/</summaryimagefile>

As per the previous comment in this thread, I have also tried to provide the path to myAtlas.xml when running papaya-builder.sh. None of this has worked.

I would greatly appreciate any help with this issue.

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