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

Add scatter plot of SPARE-AD and SPARE-BA #31

Merged
merged 1 commit into from
Jun 28, 2021
Merged

Add scatter plot of SPARE-AD and SPARE-BA #31

merged 1 commit into from
Jun 28, 2021

Conversation

AbdulkadirA
Copy link
Contributor

Replace dummy plot with actual plot of SPARE scores.

Copy link
Contributor

@ashishsingh18 ashishsingh18 left a comment

Choose a reason for hiding this comment

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

It crashes for me when I change view to SPARE. The error it gives is as follows:
`
(D:\ashish\Installs\Python\iStagingENV) D:\ashish\work\projects\iSTAGING-Tools>python -m iSTAGING.main --data_file D:\ashish\Data\iSTAGINGData\short.pkl.gz --harmonization_model_file D:\ashish\Data\iSTAGINGData\MUSE_harmonization_model.pkl
Traceback (most recent call last):
File "D:\ashish\work\projects\iSTAGING-Tools\iSTAGING\plotcanvas.py", line 82, in PlotSPARE
s=5, data=datamodel.GetData(['SPARE_BA','SPARE_AD'],
File "D:\ashish\work\projects\iSTAGING-Tools\iSTAGING\datamodel.py", line 76, in GetData
d = self.data[roi + ["Age",hue]]
File "D:\ashish\Installs\Python\iStagingENV\lib\site-packages\pandas\core\frame.py", line 3030, in getitem
indexer = self.loc._get_listlike_indexer(key, axis=1, raise_missing=True)[1]
File "D:\ashish\Installs\Python\iStagingENV\lib\site-packages\pandas\core\indexing.py", line 1266, in _get_listlike_indexer
self._validate_read_indexer(keyarr, indexer, axis, raise_missing=raise_missing)
File "D:\ashish\Installs\Python\iStagingENV\lib\site-packages\pandas\core\indexing.py", line 1316, in _validate_read_indexer
raise KeyError(f"{not_found} not in index")
KeyError: "['SPARE_BA', 'SPARE_AD'] not in index"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\ashish\work\projects\iSTAGING-Tools\iSTAGING\mainwindow.py", line 400, in OnViewChanged
self.UpdatePlot()
File "D:\ashish\work\projects\iSTAGING-Tools\iSTAGING\mainwindow.py", line 296, in UpdatePlot
self.plotCanvas.Plot(self.model,plotOptions)
File "D:\ashish\work\projects\iSTAGING-Tools\iSTAGING\plotcanvas.py", line 38, in Plot
self.PlotSPARE(datamodel,plotOptions)
File "D:\ashish\work\projects\iSTAGING-Tools\iSTAGING\plotcanvas.py", line 84, in PlotSPARE
except e:
NameError: name 'e' is not defined
`

@AbdulkadirA
Copy link
Contributor Author

Crash should be addressed. Happened when no SPARE-* scores were available in data set.

@ashishsingh18
Copy link
Contributor

@AbdulkadirA Can you share the SPARE data that will produce the SPARE plot?

Also, can you please propagate the error message to mainwindow so we can show an error message as a pop up? We just need to return the error message you are currently displaying on plotcanvas from the function.

@AbdulkadirA
Copy link
Contributor Author

@ashishsingh18 Thanks. I sent you the path via Teams.

How do I return the value. Do you mean adding return 'Plotting failed. ...'? What if plotting is successful? Where it will be picked up? mainwindow does not call PlotSPARE().

@ashishsingh18
Copy link
Contributor

@ashishsingh18 Thanks. I sent you the path via Teams.

How do I return the value. Do you mean adding return 'Plotting failed. ...'? What if plotting is successful? Where it will be picked up? mainwindow does not call PlotSPARE().

So we will need to return a bool as well - for plot successful or failed.

If (failed)
   we show message 

Will it always fail due to lack of SPARE scores? If yes, we don't need to send message, just a bool will be sufficient and we can handle this in mainwindow.

Plot() function which is called by mainwindow, will also need to return it.

@ashishsingh18
Copy link
Contributor

If this is confusing, let's discuss this first and we can always add this later.

@ashishsingh18 ashishsingh18 self-requested a review June 25, 2021 23:15
Copy link
Contributor

@ashishsingh18 ashishsingh18 left a comment

Choose a reason for hiding this comment

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

Looks fine. We can add pop up message later.

@AbdulkadirA
Copy link
Contributor Author

@ashishsingh18 Thanks. Let's merge for now and I'll open an issue to handle missing SPARE-*.

@AbdulkadirA AbdulkadirA merged commit 751d04b into CBICA:main Jun 28, 2021
@AbdulkadirA AbdulkadirA deleted the Plot-SPAREs branch December 1, 2021 15:36
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

Successfully merging this pull request may close these issues.

None yet

2 participants