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

README.md Update and Documentation Proposal #105

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

maxradx
Copy link
Member

@maxradx maxradx commented Nov 18, 2024

Hi Team,

This Pull Request updates the README.md and adds essential Documentation for testing, from which further comments/documentation can be built on.

How to test this PR? (3 steps):

1- Start from scratch, do as it is the first time you use slicer. Follow Installation steps from the README.
2- Try QuickSTART in the README.md.
3- Read Documentation from Documentation Welcome Page.

Question to ask yourself (examples):

A. Was the installation process without obstruction and difficulties (Slicer and SlicerCART)?
B. Was I able to load images from my dataset? Once loaded, was I able to do manual segmentation as written in the QuickStart?
C. Any feedback/comments regarding the organization set-up of the documentation? When you read those instructions, are they easy for you to understand?

Important Note.
This PR is a pre-beta-release version of SlicerCART. That means the actual main script is really NOT READY for deployment. Only one basic scenario is intended to be tested for now (viewing images and annotate them). Essential functionalities remain to be implemented (bugs fixing e.g. changing labels, load previous segmentations, compare segments, go automatically to the next case, etc.). Accordingly, you should approach this PR as a Documentation PR as mentioned above: are the steps for begin using SlicerCART clear? (Your feedback will be wanted in future PR related to specific functionalities)

This PR addresses issue #62.

Thank you for your consideration.

Maxime

This was unlinked from issues Nov 18, 2024
This was referenced Nov 18, 2024
@maxradx maxradx added documentation Improvements or additions to documentation help wanted Extra attention is needed priority high To manage as soon as possible. Anything within the big picture, not nit-picky. labels Nov 18, 2024
Copy link
Member

@sandrinebedard sandrinebedard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for putting all of this together! I followed the instructions, I left some minor comments about the instructions, in general, it is okay!

However, I cannot load the module (step 7):

Capture d’écran, le 2024-11-19 à 16 46 19

when I search for it, it is says it can't be loaded:
Capture d’écran, le 2024-11-19 à 16 47 01

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
SlicerCART/documentation/installation.md Outdated Show resolved Hide resolved
SlicerCART/documentation/installation.md Outdated Show resolved Hide resolved
SlicerCART/documentation/installation.md Outdated Show resolved Hide resolved
SlicerCART/documentation/installation.md Outdated Show resolved Hide resolved
SlicerCART/documentation/installation.md Outdated Show resolved Hide resolved
SlicerCART/documentation/installation.md Outdated Show resolved Hide resolved
@maxradx
Copy link
Member Author

maxradx commented Nov 20, 2024

Thank you for putting all of this together! I followed the instructions, I left some minor comments about the instructions, in general, it is okay!

However, I cannot load the module (step 7):

Capture d’écran, le 2024-11-19 à 16 46 19

when I search for it, it is says it can't be loaded: Capture d’écran, le 2024-11-19 à 16 47 01

Ok! 1- Now with the new instructions adapted, can you try it again? (maybe that is because of the part of the comment you left where you did not know what I meant! --- ex drag the SlicerCART.py file in the additional module path section (see step 4 in the most recent committed version --- need to fetch and pull)

2- Can you open the python console and screenshot the line where there is the error? (there should have some errors when a slicer module cannot be instantiated).

Thanks for your feedback: greatly appreciated!

@sandrinebedard
Copy link
Member

2- Can you open the python console and screenshot the line where there is the error? (there should have some errors when a slicer module cannot be instantiated).

same thing again, here is the error in the python console:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Applications/Slicer.app/Contents/lib/Python/lib/python3.9/imp.py", line 169, in load_source
    module = _exec(spec, sys.modules[name])
  File "<frozen importlib._bootstrap>", line 613, in _exec
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/sandrinebedard/code/slicer-manual-annotation/SlicerCART/src/SlicerCART.py", line 10, in <module>
    from utils import * # Import all modules, packages and global variables
  File "/Users/sandrinebedard/code/slicer-manual-annotation/SlicerCART/src/utils/__init__.py", line 1, in <module>
    from .global_variables import *
  File "/Users/sandrinebedard/code/slicer-manual-annotation/SlicerCART/src/utils/global_variables.py", line 3, in <module>
    from utils.requirements import *
  File "/Users/sandrinebedard/code/slicer-manual-annotation/SlicerCART/src/utils/requirements.py", line 27, in <module>
    check_and_install_python_packages()
  File "/Users/sandrinebedard/code/slicer-manual-annotation/SlicerCART/src/utils/install_python_packages.py", line 31, in check_and_install_python_packages
    response = qt.QMessageBox.question(slicer.util.mainWindow(),
NameError: name 'qt' is not defined
[Qt] loadSourceAsModule - Failed to load file "/Users/sandrinebedard/code/slicer-manual-annotation/SlicerCART/src/SlicerCART.py"  as module "SlicerCART" !
[Qt] Fail to instantiate module  "SlicerCART"
[Qt] The following modules failed to be instantiated:
[Qt]    SlicerCART
[Qt] Populating font family aliases took 138 ms. Replace uses of missing font family ".AppleSystemUIFont" with one that exists to avoid this cost. 

SlicerCART/documentation/installation.md Outdated Show resolved Hide resolved
![](images/module_filepath.png)

(N.B. 1- You must have the file:
if it is the folder path, then the module will not work; 2- in the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it is the folder path

if what is the folder path? this sentence is unclear, I get that the SlicerCART.py needs to be in the folder, but this is not what your sentence is telling me

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I see. Adapted. Better?

@maxradx
Copy link
Member Author

maxradx commented Nov 20, 2024

2- Can you open the python console and screenshot the line where there is the error? (there should have some errors when a slicer module cannot be instantiated).

same thing again, here is the error in the python console:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Applications/Slicer.app/Contents/lib/Python/lib/python3.9/imp.py", line 169, in load_source
    module = _exec(spec, sys.modules[name])
  File "<frozen importlib._bootstrap>", line 613, in _exec
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/sandrinebedard/code/slicer-manual-annotation/SlicerCART/src/SlicerCART.py", line 10, in <module>
    from utils import * # Import all modules, packages and global variables
  File "/Users/sandrinebedard/code/slicer-manual-annotation/SlicerCART/src/utils/__init__.py", line 1, in <module>
    from .global_variables import *
  File "/Users/sandrinebedard/code/slicer-manual-annotation/SlicerCART/src/utils/global_variables.py", line 3, in <module>
    from utils.requirements import *
  File "/Users/sandrinebedard/code/slicer-manual-annotation/SlicerCART/src/utils/requirements.py", line 27, in <module>
    check_and_install_python_packages()
  File "/Users/sandrinebedard/code/slicer-manual-annotation/SlicerCART/src/utils/install_python_packages.py", line 31, in check_and_install_python_packages
    response = qt.QMessageBox.question(slicer.util.mainWindow(),
NameError: name 'qt' is not defined
[Qt] loadSourceAsModule - Failed to load file "/Users/sandrinebedard/code/slicer-manual-annotation/SlicerCART/src/SlicerCART.py"  as module "SlicerCART" !
[Qt] Fail to instantiate module  "SlicerCART"
[Qt] The following modules failed to be instantiated:
[Qt]    SlicerCART
[Qt] Populating font family aliases took 138 ms. Replace uses of missing font family ".AppleSystemUIFont" with one that exists to avoid this cost. 

Ok! Thanks for the input.
If you copy paste this command in the slicer python console, and then try to use the module, what does it says? (success or error in python console)

import slicer
from slicer.util import qt

thanks!

@jcohenadad jcohenadad self-requested a review November 20, 2024 16:58
@maxradx
Copy link
Member Author

maxradx commented Nov 20, 2024

2- Can you open the python console and screenshot the line where there is the error? (there should have some errors when a slicer module cannot be instantiated).

same thing again, here is the error in the python console:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Applications/Slicer.app/Contents/lib/Python/lib/python3.9/imp.py", line 169, in load_source
    module = _exec(spec, sys.modules[name])
  File "<frozen importlib._bootstrap>", line 613, in _exec
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/sandrinebedard/code/slicer-manual-annotation/SlicerCART/src/SlicerCART.py", line 10, in <module>
    from utils import * # Import all modules, packages and global variables
  File "/Users/sandrinebedard/code/slicer-manual-annotation/SlicerCART/src/utils/__init__.py", line 1, in <module>
    from .global_variables import *
  File "/Users/sandrinebedard/code/slicer-manual-annotation/SlicerCART/src/utils/global_variables.py", line 3, in <module>
    from utils.requirements import *
  File "/Users/sandrinebedard/code/slicer-manual-annotation/SlicerCART/src/utils/requirements.py", line 27, in <module>
    check_and_install_python_packages()
  File "/Users/sandrinebedard/code/slicer-manual-annotation/SlicerCART/src/utils/install_python_packages.py", line 31, in check_and_install_python_packages
    response = qt.QMessageBox.question(slicer.util.mainWindow(),
NameError: name 'qt' is not defined
[Qt] loadSourceAsModule - Failed to load file "/Users/sandrinebedard/code/slicer-manual-annotation/SlicerCART/src/SlicerCART.py"  as module "SlicerCART" !
[Qt] Fail to instantiate module  "SlicerCART"
[Qt] The following modules failed to be instantiated:
[Qt]    SlicerCART
[Qt] Populating font family aliases took 138 ms. Replace uses of missing font family ".AppleSystemUIFont" with one that exists to avoid this cost. 

added in the code. see comments that you are tagged (I don't know how to refer from here to the code).


* MacOS Sonoma or Sequoia (15.0.1) is recommended
* A working version of [3D Slicer](https://download.slicer.org) (version 5.6.2).
* Qt: might need to be installed.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sandrinebedard from your comments "2- Can you open the python console and screenshot the line where there is the error? (there should have some errors when a slicer module cannot be instantiated).

same thing again, here is the error in the python console:"

@sandrinebedard
Copy link
Member

Can you try:

import slicer
slicer.util.pip_install('qt')

or using the expresion 'Qt' with capital letters? (also for from slicer.util import Qt)

Does this provide an error?

does not work, even with Qt

image

@maxradx
Copy link
Member Author

maxradx commented Nov 21, 2024

Can you try:

import slicer
slicer.util.pip_install('qt')

or using the expresion 'Qt' with capital letters? (also for from slicer.util import Qt)
Does this provide an error?

does not work, even with Qt

image

Ok. Will look further in the following days. If ever you know find out how to install Qt , please comment it so I can add it in the procedural steps. Thanks for your insight.

Copy link

@tomDag25 tomDag25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't look into quickstart.md nor userguide.md because it looks like both are really close and you should just keep one in my opinion. If you think I should review both tell me but else I will wait you delete one to not review two times the same thing.
Also a general comment I feel like putting GO BACK to... at the end of your Markdown is maybe not necessary in most cases: either you want people to follow a path (for example from installation to quickstart) or they have to go back to the README.md but most links seem to be random.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
SlicerCART/documentation/installation.md Outdated Show resolved Hide resolved
SlicerCART/documentation/installation.md Outdated Show resolved Hide resolved
SlicerCART/documentation/installation.md Outdated Show resolved Hide resolved
SlicerCART/documentation/videotutorials.md Show resolved Hide resolved
Comment on lines +1 to +35
# Welcome to SlicerCART Documentation
Here is useful information for using SlicerCART in 3D Slicer.

Please click on the following links to get started.

* [Installation](installation.md)
* [QuickStart](quickstart.md)
* [Video Tutorials](videotutorials.md)
* [User Guide](userguide.md) (contains detailed information)
* [Developer Guide](../../CONTRIBUTING.md) (Contributing Guidelines)

### Description

SlicerCART is a 3D Slicer extension aimed to improve manual segmentation and classification
workflows across different teams.

More information about SlicerCART Purpose can be found [here](purpose.md).

List of functionalities can be found [here](functionalities.md).

**Keywords:** medical imaging, manual segmentation, manual correction, workflow, ground-truth segmentation, quality control

**Abbreviations:**

- MRI - Magnetic Resonance Imaging
- CT - Computed Tomography
- BIDS - Brain Imaging Data Structure
- GUI - Graphical User Interface
- QC - Quality Control


### Other resources
* [3D Slicer Tutorials](https://www.youtube.com/watch?v=QTEti9aY0vs&)
* [3D Slicer Documentation](https://www.slicer.org/wiki/Documentation/Nightly/Training)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

People won't look at your Welcome.md they will read your README.md and go to the md files you cite in it. Would delete this file and put the information you judge primordial in README.md

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok Considered. Thanks for this input. You are right. However, when I go on successful slicer app (e.g. SlicerRT) there readme is very short and they refer to other documentation pages with more details. this is also in other slicer modules. Will keep the comment opened so others can give there input (I agree with you that this could be in the README as well)


## Requirements

* MacOS Sonoma or Sequoia (15.0.1) is recommended
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's way too specific. What if 15.0.2 comes out? Can I use it? likely so. I suggest another wording, be more general to other distros (see eg how we do it in SCT).


* MacOS Sonoma or Sequoia (15.0.1) is recommended
* [3D Slicer](https://download.slicer.org) version 5.6.2.
* Qt: might need to be installed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? it should or it should not. This statement is confusing for the user

@jcohenadad
Copy link
Member

@maxradx a lot of suggested commits are a month-old. Can you please accept them so we can make additional commit suggestions?

Copy link
Member

@jcohenadad jcohenadad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot of additional images in this PR. Although the intention is good (screenshots for the documentation to improve user experience), adding binary files to a git repository is problematic. Given that these screenshots belong to a specific version of slicerCART, which is bound to evolve with time, all these screenshots will need to be updated, again and again, with the repository accumulating fat overtime. In general, it is not a good practice to upload binaries to a git repository. See eg:

I suggest opening another repos to store the images, eg: slicer-cart-media.

Also important: make sure to provide the sources of your edited screenshots. Eg: what if you made a typo in the edited screenshot, that someone would like to fix later? Working with cloud solution (eg drawIO, google slide) makes it easy to modify images.

Finally: because of the above issues, I think this PR should not be merged as is with all these binaries. And if they are removed from the branch (following my recommendations), then that branch, if accepted, should absolutely be 'squashed' before merging, otherwise the binaries will exist in the git history and it will be a pain to remove them.

Comment on lines +9 to +16
The current version **IS NOT** able to:
- Edit segmentation labels
- Continue segmentation/classification tasks from previously started work
- Adjust by default the window width (some dataset provides blank images
that need to be adjusted automatically. If it's the case, mention your
concern in [issue 67](https://github.com/neuropoly/slicer-manual-annotation/issues/67))
- Go automatically to the next case after having saved a segmentation
- Compare multiple segments and revise them ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't mention what it cannot do. Just say what it can do

appreciated for 1) Installation steps 2) Loading datasets 3) General Insight.


### Before starting
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can remove

Comment on lines +43 to +47
###### 3. Select "New Configuration", and click on Next
When the module is loaded, a pop-up window appears and allow the user to
customize SlicerCART settings.

![Alt Text](images/select_configuration_popup.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i had already clicked "new config and next" after reading line 43. Then, the following tell the same thing-- i found it confusing


![Alt Text](images/select_configuration_popup.png)

###### 4. Specify the appropriate dataset options and tasks, and then click Apply
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to echo my previous comment, what i find confusing is that the headings tells you what to do. So i do it. And then, what's below the heading is already done.



###### 5. Select Volumes folder, and specify annotator information
* Select the folder that contains the images that you want to process (if
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sentence not finished

use those (soon, it should be able to modify them by clicking on Configure
Segmentation). The same applies for "Configure Classification".

![Alt Text](images/select_configuration_module.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some issues with the text of that screenshot-- easier to manually fix it, but I cannot (because screenshot is not editable)-- related to #105 (review)

Comment on lines +74 to +76
N.B. If loading cases in the UI fails, please open an issue on the Github
repository or ask a team member. If this steps has not succeed, you will
not be able to use SlicerCART (e.g. imaging format incompatibility).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove-- just put a section "Help" somewhere in your documentation.


###### 8. Start Segmentation
Click on the case you want to
Start segmentation by clicking on:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to click on "Segmentation" first, to drop down that menu

Click on the case you want to
Start segmentation by clicking on:
- SegmentEditor: will open the default segment editor of 3D Slicer
- Paint: will make the user able to paint the **first** mask label
Copy link
Member

@jcohenadad jcohenadad Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I clicked on "SegmentEditor", and now I don't see the "Paint" button anymore:

image

Consider telling users to click again on "Modules -> Examples -> SlicerCART"

Click on the case you want to
Start segmentation by clicking on:
- SegmentEditor: will open the default segment editor of 3D Slicer
- Paint: will make the user able to paint the **first** mask label
Copy link
Member

@jcohenadad jcohenadad Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that "paint" button is a bit obscure to me. After switching to the SegmentEditor, I can already create the first label. So what is this button useful for? When I click on it, nothing happens.

EDIT 20241216_172912: OK, I just realized that the "Paint" button is to avoid going to the SegmentEditor. I'm not sure this is a judicious design choice, because there is already a button that brings the user to the Segment Editor. I suggest opening an issue on this to discuss it further.

Start segmentation by clicking on:
- SegmentEditor: will open the default segment editor of 3D Slicer
- Paint: will make the user able to paint the **first** mask label
- Erase: will make the user able to erase current segment label
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's called "Erase mode"


###### 9. Save Segmentation
Once segmentation is completed, click on Save segmentation to save the
segmentation mask in the output folder. Note that a .csv file will be
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saving a JSON that is BIDS compatible with derivatives would be much better-- pls open an issue on this


![Alt Text](images/perform_segmentation.png)

###### 9. Save Segmentation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this segment only one class? two classes are highlighted in the example above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed priority high To manage as soon as possible. Anything within the big picture, not nit-picky.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve README
4 participants