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

Register test data as SampleDataSource #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jcfr
Copy link
Contributor

@jcfr jcfr commented Apr 29, 2022

Remove the copy of local data and instead register a SampleDataSource to be downloaded as needed.

Remove the copy of local data and instead register a
SampleDataSource to be downloaded as needed.

Co-authored-by: Jean-Christophe Fillion-Robin <[email protected]>
@jcfr jcfr changed the title ENH: Register test data as SampleDataSource Register test data as SampleDataSource Apr 29, 2022
@jcfr jcfr marked this pull request as draft April 29, 2022 14:24
category='ShapeVariationAnalyzer',
uris='https://data.kitware.com/api/v1/item/626850ed4acac99f42121c7f/download',
loadFiles=True, # Unzip it
fileNames='ShapeVariationAnalyzerSampleData.zip',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Few comments:

  • There already a file called SVASampleData.zip on the server. It is available at https://data.kitware.com/#collection/586fbb7b8d777f05f44a5c7b/folder/5d5c195085f25b11ff3e1ad8

  • After looking at the SHA512 of the one associated with the SampleDataSource, I realized that the file downloaded is instead in a Public folder associated with a user (see screenshot below). We should avoid doing and instead consistently organize the zip files.

  • The zip files should all be versioned (e.g SVASampleData-YYYY-MM-DD.zip

image

Comment on lines +2568 to +2572
filepath_in = f"{base_dir}test.csv"
with open(filepath_in, "w") as csv_file:
csv_file.write("VTK Files,Group\n")
for vtk_file in vtk_files:
csv_file.write(f"{vtk_file},0\n")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Crafting the csv file here is counter productive, any one who would like to try to load the datasets independently would have to manually recreate the file.

Instead, the csv file should be provided and this issue #64 should be addressed.

# ShapeVariationAnalyzerSampleData
#

class ShapeVariationAnalyzerSampleData(ScriptedLoadableModule):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of introducing a new module ... may be worth adopting the style of the template. See https://github.com/Slicer/Slicer/blob/ab0aa85f93e226f40250857ec1c0b09304c4ea16/Utilities/Templates/Modules/Scripted/TemplateKey.py#L45-L50

And considering the reuse of the the sample data directly from SlicerSALT

@jcfr jcfr marked this pull request as ready for review April 29, 2022 14:49
@jcfr
Copy link
Contributor Author

jcfr commented Apr 29, 2022

@jamesfishbaugh Since the previous pull request was submitted independently so that it could be reviewed, I forced pushed master and re-open a new one.

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.

2 participants