Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision a2e6a2b1dd1da48e502fc25126aa9b8a139ed543 authored by GUANGMING ZANG on 13 August 2018, 08:44:48 UTC, committed by GitHub on 13 August 2018, 08:44:48 UTC
Update README.md
1 parent 80d039c
  • Files
  • Changes
  • 6fa5ac5
  • /
  • Scanner_script
  • /
  • scriptXML.m
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:a2e6a2b1dd1da48e502fc25126aa9b8a139ed543
directory badge
swh:1:dir:6f140fb5721d5f05cf562292a35c9c40212cb282
content badge
swh:1:cnt:f5a528ddf201fb429ef1f9f344146bfa00330443

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
scriptXML.m
clear all, close all, clc;

p = 2;     % base
Np = 4000;  % Nb projections
Ns = 10;   % Partition of the circle into Ns segments
Nz = 10000;   % Add a projection at a reference angle each Nz projections

Seq = Low_discrepency_squence(Np,Ns,p,Nz);
Seq_reshap = reshape(Seq,Ns,floor(Np/Ns))';



name = 'yflo';
filename = 'ctprofile.xml';
CtScannXML = parseXML(filename);

idx=1;

for ang = 1:floor(Np/Ns)

CtScannXML.Children(2).Children.Data =  [num2str(idx) '.' name];
idx = idx + 1;
CtScannXML.Children(4).Children(8).Children.Data = num2str(Seq_reshap(ang,1));

nbChildren = (size(CtScannXML.Children,2)-1)/2;

docNode = com.mathworks.xml.XMLUtils.createDocument(CtScannXML.Name);
docRootNode = docNode.getDocumentElement;

for i=1:size(CtScannXML.Attributes(),2)
    docRootNode.setAttribute(CtScannXML.Attributes(i).Name,CtScannXML.Attributes(i).Value);
end

for i=1:nbChildren
    thisElement = docNode.createElement(CtScannXML.Children(2*i).Name);
    
    CtScannXML.Children(2*i).Name
    
    nbGC = (size(CtScannXML.Children(2*i).Children,2)-1)/2;
    
    if nbGC<0
        docRootNode.appendChild(thisElement);
    elseif nbGC==0
        thisElement.appendChild(docNode.createTextNode(...
            CtScannXML.Children(2*i).Children.Data));
        docRootNode.appendChild(thisElement);
        
    else
    	for j = 1:nbGC
            thisChild = docNode.createElement(CtScannXML.Children(2*i).Children(2*j).Name);
            
            nbGGC = (size(CtScannXML.Children(2*i).Children(2*j).Children,2)-1)/2;
            
            if nbGGC==0
                thisChild.appendChild(docNode.createTextNode(...
                    CtScannXML.Children(2*i).Children(2*j).Children.Data));
                
            else
                for k = 1:nbGGC
                    thisGChild = docNode.createElement(CtScannXML.Children(2*i).Children(2*j).Children(2*k).Name);
                    thisGChild.appendChild(docNode.createTextNode(...
                        CtScannXML.Children(2*i).Children(2*j).Children(2*k).Children.Data));
                    thisChild.appendChild(thisGChild);
                end
            end
            thisElement.appendChild(thisChild);
            
            if size(CtScannXML.Children(2*i).Attributes(),2)
                for att=1:size(CtScannXML.Children(2*i).Attributes(),2)
                    thisElement.setAttribute(CtScannXML.Children(2*i).Attributes(att).Name,CtScannXML.Children(2*i).Attributes(att).Value);
                end
            end
            docRootNode.appendChild(thisElement);    
        end
    end
end

xmlFileName = strcat('XMLfiles/', name , sprintf('%04d',ang) ,'.ctprofile.xml');
xmlwrite(xmlFileName,docNode);
type(xmlFileName);
end
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API