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

Changed Chinese Locale file name, Add GB2312 character set, fix ellipse resize error. #269

Closed
wants to merge 4 commits into from

Conversation

Refactoring
Copy link

I am a Chinese, my English is not very good. My commits log using the Bing translation from Chinese into English. Hope it will not affect the description of the journal, your reading.

@ivmartel
Copy link
Owner

Thanks for all this! I split your request into multiples:

About the GB2312 character set, do you have data with it that you could share for testing?

@Refactoring
Copy link
Author

Refactoring commented Sep 27, 2016

GB2312 DCM Test Data
Focus tag:
(0008,0080) Institution Name LO 1 测试医院
(0010,0010) Patient's Name PN 1 赵桂香


I wrote this test, do not know the appropriate or not?
tests\dicom\dicomParser.test.js

/**
 * Tests for {@link dwv.dicom.DicomParser} using gb2312 test DICOM data.
 * Using remote file for CI integration.
 * @function module:tests/dicom~dicomParser
 */
QUnit.test("Test gb2312 DICOM parsing.", function (assert) {
    var done = assert.async();

    var request = new XMLHttpRequest();
    var urlRoot = "https://raw.githubusercontent.com/ivmartel/dwv/master";
    var url = urlRoot + "/tests/data/dwv-test-gb2312.dcm";
    request.open('GET', url, true);
    request.responseType = "arraybuffer";
    request.onload = function (/*event*/) {
        assert.ok((this.response.byteLength!==0), "Got a response.");

        // parse DICOM
        var dicomParser = new dwv.dicom.DicomParser();
        dicomParser.parse(this.response);
        // raw tags
        var rawTags = dicomParser.getRawDicomElements();
        assert.ok((Object.keys(rawTags).length!==0), "Got raw tags.");
        // wrapped tags
        var tags = dicomParser.getDicomElements();
        assert.ok((tags.dumpToTable().length!==0), "Got wrapped tags.");

        // SpecificCharacterSet: Specific Character Set
        var seq00 = tags.getFromName("SpecificCharacterSet");
        assert.equal(seq00.length, 6, "ReferringSpecificCharacterSet length");
        assert.equal(seq00.value, "GB2312", 
                "ReferringPhysicianIdentificationSequence item value");

        // InstitutionName: Institution Name
        var seq01 = tags.getFromName("InstitutionName");
        assert.equal(seq01.length, 4, "ReferringInstitutionName length");
        assert.equal(seq01.value, "测试医院", 
                "ReferringInstitutionName item value"); 

        // PatientName: Patient's Name
        var seq02 = tags.getFromName("PatientName");
        assert.equal(seq02.length, 3, "ReferringPatientName length");
        assert.equal(seq02.value, "赵桂香", 
                "ReferringPatientName item value");         

        // finish async test
        done();
    };
    request.send(null);
});

@ivmartel
Copy link
Owner

Ok fixed GB2312 in #273. All your changes were integrated, 3q!
Closing request, feel free to reopen if I missed something.

@ivmartel ivmartel closed this Sep 27, 2016
@ivmartel ivmartel added the enhancement New feature or request label Oct 30, 2017
@ivmartel ivmartel modified the milestones: 0.16.0, 0.17.0 Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants